10 #ifndef tty_ttyErrors_hpp 11 #define tty_ttyErrors_hpp 13 #define TTY_E_NOERROR (0) 14 #define TTY_E_TCGETATTR (-42001) 15 #define TTY_E_SETISPEED (-42002) 16 #define TTY_E_SETOSPEED (-42003) 17 #define TTY_E_TCSETATTR (-42004) 18 #define TTY_E_TIMEOUTONWRITEPOLL (-42011) 19 #define TTY_E_ERRORONWRITEPOLL (-42012) 20 #define TTY_E_ERRORONWRITE (-42013) 21 #define TTY_E_TIMEOUTONWRITE (-42014) 22 #define TTY_E_TIMEOUTONREADPOLL (-42015) 23 #define TTY_E_ERRORONREADPOLL (-42016) 24 #define TTY_E_ERRORONREAD (-42017) 25 #define TTY_E_TIMEOUTONREAD (-42018) 26 #define TTY_E_NODEVNAMES (-42021) 27 #define TTY_E_UDEVNEWFAILED (-42022) 28 #define TTY_E_DEVNOTFOUND (-42023) 29 #define TTY_E_BADBAUDRATE (-42030) 31 #define TELNET_E_GETADDR (-42040) 32 #define TELNET_E_SOCKET (-42041) 33 #define TELNET_E_BIND (-42042) 34 #define TELNET_E_CONNECT (-42043) 35 #define TELNET_E_TELNETINIT (-42044) 36 #define TELNET_E_EHERROR (-42045) 55 return "TTY: success";
57 return "TTY: tcgetattr returned error";
59 return "TTY: cfsetispeed returned error";
61 return "TTY: cfsetospeed returned error";
63 return "TTY: tcsetattr returned error";
65 return "TTY: the write poll timed out";
67 return "TTY: an error was returned by the write poll";
69 return "TTY: an error occurred writing to the file";
71 return "TTY: a timeout occurred during the write";
73 return "TTY: the read poll timed out";
75 return "TTY: an error was returned by the read poll";
77 return "TTY: an error occurred reading from the file";
79 return "TTY: a timeout occurred during the read";
81 return "TTY: no device names found in sys";
83 return "TTY: initializing libudev failed";
85 return "TTY: no matching device found";
87 return "TTY: bad baud rate specified";
90 return "TTY: getaddr failed";
92 return "TTY: socket creation failed";
94 return "TTY: socket bind failed";
96 return "TTY; socket connect failed";
98 return "TTY: failed to init telnet_t structure";
100 return "TTY: error set in telnet event handler";
102 return "TTY: unknown error code";
109 #endif //tty_ttyErrors_hpp
#define TTY_E_ERRORONREAD
#define TTY_E_ERRORONREADPOLL
#define TTY_E_ERRORONWRITE
#define TELNET_E_TELNETINIT
std::string ttyErrorString(int ec)
Get a text explanation of a TTY_E_ error code.
#define TTY_E_ERRORONWRITEPOLL
#define TTY_E_TIMEOUTONREADPOLL
#define TTY_E_DEVNOTFOUND
#define TTY_E_TIMEOUTONWRITEPOLL
#define TTY_E_UDEVNEWFAILED
#define TTY_E_TIMEOUTONWRITE
#define TTY_E_BADBAUDRATE
#define TTY_E_TIMEOUTONREAD