API

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

#include <string>
#include <vector>
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <termios.h>
Include dependency graph for ttyIOUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 MagAOX
 
 MagAOX::tty
 

Macros

#define TTY_BUFFSIZE   (1024)
 

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)

History:

  • 2018-01-15 created by JRM, starting with code imported from VisAO

Definition in file ttyIOUtils.hpp.

Macro Definition Documentation

◆ TTY_BUFFSIZE

#define TTY_BUFFSIZE   (1024)

Definition at line 23 of file ttyIOUtils.hpp.