API

Utilities for i/o on a file descriptor pointing to a tty device. More...

#include "ttyIOUtils.hpp"
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <termios.h>
#include <mx/sys/timeUtils.hpp>
#include "ttyErrors.hpp"
Include dependency graph for ttyIOUtils.cpp:

Go to the source code of this file.

Namespaces

 MagAOX
 
 MagAOX::tty
 

Functions

int MagAOX::tty::telnetCRLF (std::string &telnetStr, const std::string &inputStr)
 Replace lone \r and \n with \r\n for telnet-ness. More...
 
int MagAOX::tty::ttyOpenRaw (int &fileDescrip, std::string &deviceName, speed_t speed)
 Open a file as a raw-mode tty device. More...
 
bool MagAOX::tty::isEndOfTrans (const std::string &strRead, const std::string &eot)
 Check if the end of the buffer contains the end-of-transmission string. More...
 
int MagAOX::tty::ttyWrite (const std::string &buffWrite, int fd, int timeoutWrite)
 Write to the tty console indicated by a file descriptor. More...
 
int MagAOX::tty::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. More...
 
int MagAOX::tty::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. More...
 
int MagAOX::tty::ttyRead (std::string &strRead, const std::string &eot, int fd, int timeoutRead)
 Read from a tty console indicated by a file-descriptor, until an end of transmission string is read. More...
 
int MagAOX::tty::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. More...
 

Detailed Description

Utilities for i/o on a file descriptor pointing to a tty device.

Author
Jared R. Males (jared.nosp@m.male.nosp@m.s@gma.nosp@m.il.c.nosp@m.om)

Definition in file ttyIOUtils.cpp.