10 #ifndef tty_ttyIOUtils_hpp
11 #define tty_ttyIOUtils_hpp
23 #define TTY_BUFFSIZE (1024)
41 const std::string & inputStr
55 std::string & deviceName,
67 const std::string & eot
81 int ttyWrite(
const std::string & buffWrite,
96 int ttyReadRaw( std::vector<unsigned char> & vecRead,
112 int ttyRead( std::string & strRead,
128 int ttyRead( std::string & strRead,
129 const std::string & eot,
151 const std::string & strWrite,
152 const std::string & eot,
int ttyReadRaw(std::vector< unsigned char > &vecRead, int &readBytes, int fd, int timeoutRead)
Read from a tty console indicated by a file-descriptor, up to a given number of bytes.
int ttyWriteRead(std::string &strRead, const std::string &strWrite, const std::string &eot, bool swallowEcho, int fd, int timeoutWrite, int timeoutRead)
Write to a tty on an open file descriptor, then get the result.
int ttyWrite(const std::string &buffWrite, int fd, int timeoutWrite)
Write to the tty console indicated by a file descriptor.
int ttyRead(std::string &strRead, int bytes, int fd, int timeoutRead)
Read from a tty console indicated by a file-descriptor, until a given number of bytes are read.
int ttyOpenRaw(int &fileDescrip, std::string &deviceName, speed_t speed)
Open a file as a raw-mode tty device.
bool isEndOfTrans(const std::string &strRead, const std::string &eot)
Check if the end of the buffer contains the end-of-transmission string.
int telnetCRLF(std::string &telnetStr, const std::string &inputStr)
Replace lone \r and \n with \r\n for telnet-ness.