class TTYStream

streamable tty serial I/O class. More...

Definition#include <serial.h>
InheritsSerial, streambuf, iostream
Inherited byttystream, TTYSession
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

TTY streams are used to represent serial connections that are fully "streamable" objects using C++ stream classes and friends.

TTYStream ()
[protected]

This constructor is used to derive "ttystream", a more C++ style version of the TTYStream class.

void Allocate (void)
[protected]

Used to allocate the buffer space needed for iostream operations. This is based on MAX_INPUT.

void endStream (void)
[protected]

Used to terminate the buffer space and clean up the tty connection. This function is called by the destructor.

int 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.

int overflow (int ch)
[protected]

This streambuf method is used to write the output buffer through the established tty port.

Parameters:
charto push through.

Returns: char pushed through.

int sync (void)
[protected]

Flushes the stream input and out buffers, writes pending output.

Returns: 0 on success.

TTYStream (const char *filename)

Create and ipen a tty serial port.

Parameters:
charname of device to open.

~TTYStream ()

End the tty stream and cleanup.

void Interactive (bool flag)

Set tty mode to buffered or "interactive". When interactive, all streamed I/O is directly sent to the serial port immediately.

Parameters:
boolset to true to make interactive.