MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / debug_poll_fd

Function debug_poll_fd

OpenHD/ohd_telemetry/src/endpoints/SerialEndpoint.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41static std::string GET_ERROR() { return {strerror(errno)}; }
42static void debug_poll_fd(const struct pollfd& poll_fd) {
43 std::stringstream ss;
44 ss << "Poll:{";
45 if (poll_fd.events & POLLERR) {
46 ss << "POLLERR,";
47 }
48 if (poll_fd.events & POLLHUP) {
49 ss << "POLLHUP,";
50 }
51 if (poll_fd.events & POLLNVAL) {
52 ss << "POLLNVAL,";
53 }
54 ss << "}\n";
55 std::cout << ss.str();
56}
57
58// https://stackoverflow.com/questions/12340695/how-to-check-if-a-given-file-descriptor-stored-in-a-variable-is-still-valid
59static bool is_serial_fd_still_connected(const int fd) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected