ost::TTYStream(3) | Library Functions Manual | ost::TTYStream(3) |
NAME¶
ost::TTYStream - TTY streams are used to represent serial connections that are fully 'streamable' objects using C++ stream classes and friends.SYNOPSIS¶
#include <serial.h> Inherits ost::Serial. Inherited by ost::TTYSession, and ost::ttystream.Public Member Functions¶
TTYStream (const char *filename, timeout_t to=0)
Protected Member Functions¶
TTYStream ()
Protected Attributes¶
char * gbuf
Friends¶
TTYStream & crlf (TTYStream &)
Additional Inherited Members¶
Detailed Description¶
TTY streams are used to represent serial connections that are fully 'streamable' objects using C++ stream classes and friends.David Sugar dyfet@ostel.com streamable tty
serial I/O class.
Constructor & Destructor Documentation¶
ost::TTYStream::TTYStream () [protected]¶
This constructor is used to derive 'ttystream', a more C++ style version of the TTYStream class.ost::TTYStream::TTYStream (const char *filename, timeout_tto = 0)¶
Create and open a tty serial port. Parameters:filename char name of device to open.
to default timeout.
virtual ost::TTYStream::~TTYStream () [virtual]¶
End the tty stream and cleanup.Member Function Documentation¶
void ost::TTYStream::allocate (void) [protected]¶
Used to allocate the buffer space needed for iostream operations. This is based on MAX_INPUT.void ost::TTYStream::endStream (void) [protected]¶
Used to terminate the buffer space and clean up the tty connection. This function is called by the destructor.void ost::TTYStream::interactive (boolflag)¶
Set tty mode to buffered or 'interactive'. When interactive, all streamed I/O is directly sent to the serial port immediately. Parameters:flag bool set to true to make
interactive.
bool ost::TTYStream::isPending (Pendingpend, timeout_ttimeout = TIMEOUT_INF) [virtual]¶
Get the status of pending operations. This can be used to examine if input or output is waiting, or if an error has occured on the serial device. If read buffer contains data then input is ready and if write buffer contains data it is first flushed then checked. Returns:true if ready, false if timeout.
Parameters:
pend ready check to perform.
timeout in milliseconds.
int ost::TTYStream::overflow (intch) [protected]¶
This streambuf method is used to write the output buffer through the established tty port. Parameters:ch char to push through.
Returns:
char pushed through.
void ost::TTYStream::setTimeout (timeout_tto) [inline]¶
Set the timeout control. Parameters:to timeout to use.
int ost::TTYStream::sync (void)¶
Flushes the stream input and out buffers, writes pending output. Returns:0 on success.
int ost::TTYStream::uflow (void) [protected]¶
This streambuf method is used for doing unbuffered reads through the establish tty serial port when in interactive mode. Also this method will handle proper use of buffers if not in interative mode. Returns:char from tty serial port, EOF also
possible.
int ost::TTYStream::underflow (void) [protected]¶
This streambuf method is used to load the input buffer through the established tty serial port. Returns:char from get buffer, EOF also possible.
Friends And Related Function Documentation¶
TTYStream& crlf (TTYStream &) [friend]¶
TTYStream& lfcr (TTYStream &) [friend]¶
Member Data Documentation¶
char* ost::TTYStream::gbuf [protected]¶
char * ost::TTYStream::pbuf [protected]¶
timeout_t ost::TTYStream::timeout [protected]¶
Author¶
Generated automatically by Doxygen for GNU CommonC++ from the source code.Sat Jun 23 2012 | GNU CommonC++ |