#include <serial.h>
Inheritance diagram for TTYStream::
Public Methods | |
TTYStream (const char *filename) | |
Create and ipen a tty serial port. More... | |
virtual | ~TTYStream () |
End the tty stream and cleanup. More... | |
void | setTimeout (timeout_t to) |
Set the timeout control. More... | |
void | Interactive (bool flag) |
Set tty mode to buffered or "interactive". More... | |
int | sync (void) |
Flushes the stream input and out buffers, writes pending output. More... | |
bool | isPending (siopend_t pend, timeout_t timeout=TIMEOUT_INF) |
Get the status of pending operations. More... | |
Protected Methods | |
TTYStream () | |
This constructor is used to derive "ttystream", a more C++ style version of the TTYStream class. More... | |
void | Allocate (void) |
Used to allocate the buffer space needed for iostream operations. More... | |
void | endStream (void) |
Used to terminate the buffer space and clean up the tty connection. More... | |
int | underflow (void) |
This streambuf method is used to load the input buffer through the established tty serial port. More... | |
int | uflow (void) |
This streambuf method is used for doing unbuffered reads through the establish tty serial port when in interactive mode. More... | |
int | overflow (int ch) |
This streambuf method is used to write the output buffer through the established tty port. More... | |
Protected Attributes | |
char * | gbuf |
char * | pbuf |
timeout_t | timeout |
Friends | |
TTYStream & | crlf (TTYStream &) |
TTYStream & | lfcr (TTYStream &) |
The first application relevant serial I/O class is the TTYStream class. TTYStream offers a linearly buffered "streaming" I/O session with the serial device. Furthermore, traditional C++ "stream" operators (<< and >>) may be used with the serial device. A more "true" to ANSI C++ library format "ttystream" is also available, and this supports an "open" method in which one can pass initial serial device parameters immediately following the device name in a single string, as in "/dev/tty3a:9600,7,e,1", as an example.
The TTYSession aggragates a TTYStream and a Common C++ Thread which is assumed to be the execution context that will be used to perform actual I/O operations. This class is very anagolous to TCPSession.
|
This constructor is used to derive "ttystream", a more C++ style version of the TTYStream class.
|
|
Create and ipen a tty serial port.
|
|
End the tty stream and cleanup.
|
|
Used to allocate the buffer space needed for iostream operations. This is based on MAX_INPUT. |
|
Set tty mode to buffered or "interactive". When interactive, all streamed I/O is directly sent to the serial port immediately.
|
|
Used to terminate the buffer space and clean up the tty connection. This function is called by the destructor. |
|
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.
Reimplemented from Serial. |
|
This streambuf method is used to write the output buffer through the established tty port.
|
|
Set the timeout control.
|
|
Flushes the stream input and out buffers, writes pending output.
|
|
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.
|
|
This streambuf method is used to load the input buffer through the established tty serial port.
|
|
|
|
|
|
|
|
|
|
|