TTY streams are used to represent serial connections that are fully "streamable" objects using C++ stream classes and friends.
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 | overflow (int ch) |
| This streambuf method is used to write the output buffer through the established tty port. More...
|
|
| TTYStream () |
| This constructor is used to derive "ttystream", a more C++ style version of the TTYStream class.
|
|
int | uflow (void) |
| This streambuf method is used for doing unbuffered reads through the establish tty serial port when in interactive mode. More...
|
|
int | underflow (void) |
| This streambuf method is used to load the input buffer through the established tty serial port. More...
|
|
virtual int | aRead (char *Data, const int Length) |
| Reads from serial device. More...
|
|
virtual int | aWrite (const char *Data, const int Length) |
| Writes to serial device. More...
|
|
void | close (void) |
| Closes the serial device.
|
|
void | endSerial (void) |
| Used as the default destructor for ending serial I/O services. More...
|
|
Error | error (Error error, char *errstr=NULL) |
| This service is used to throw all serial errors which usually occur during the serial constructor. More...
|
|
void | error (char *err) |
| This service is used to thow application defined serial errors where the application specific error code is a string. More...
|
|
void | flushInput (void) |
| Used to flush the input waiting queue.
|
|
void | flushOutput (void) |
| Used to flush any pending output data.
|
|
void | initConfig (void) |
| Used to initialize a newly opened serial file handle. More...
|
|
void | open (const char *fname) |
| Opens the serial device. More...
|
|
void | restore (void) |
| Restore serial device to the original settings at time of open.
|
|
| Serial () |
| This allows later ttystream class to open and close a serial device.
|
|
| Serial (const char *name) |
| A serial object may be constructed from a named file on the file system. More...
|
|
void | setError (bool enable) |
| This method is used to turn the error handler on or off for "throwing" execptions by manipulating the thrown flag. More...
|
|
int | setLineInput (char newline=13, char nl1=0) |
| Set "line buffering" read mode and specifies the newline character to be used in seperating line records. More...
|
|
int | setPacketInput (int size, uint8_t btimer=0) |
| Set packet read mode and "size" of packet read buffer. More...
|
|
void | waitOutput (void) |
| Used to wait until all output has been sent.
|
|
|
enum | Error {
errSuccess = 0,
errOpenNoTty,
errOpenFailed,
errSpeedInvalid,
errFlowInvalid,
errParityInvalid,
errCharsizeInvalid,
errStopbitsInvalid,
errOptionInvalid,
errResourceFailure,
errOutput,
errInput,
errTimeout,
errExtended
} |
|
typedef enum Error | Error |
|
enum | Flow { flowNone,
flowSoft,
flowHard,
flowBoth
} |
|
typedef enum Flow | Flow |
|
enum | Parity { parityNone,
parityOdd,
parityEven
} |
|
typedef enum Parity | Parity |
|
enum | Pending { pendingInput,
pendingOutput,
pendingError
} |
|
typedef enum Pending | Pending |
|
TTY streams are used to represent serial connections that are fully "streamable" objects using C++ stream classes and friends.
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.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m streamable tty serial I/O class.
Definition at line 420 of file serial.h.