|
ucommon
|
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. More...
#include <serial.h>


Public Member Functions | |
| TTYSession (char *name, int pri=0, int stack=0) | |
| Create TTY stream that will be managed by it's own thread. | |
Public Member Functions inherited from ost::Thread | |
| void | detach (void) |
| void | exit (void) |
| virtual void | final (void) |
| void | finalize (void) |
| pthread_t | getId (void) |
| Get the thread id. | |
| virtual void | initial (void) |
| bool | isRunning (void) |
| bool | isThread (void) |
| void | join (void) |
| void | map (void) |
| virtual void | notify (Thread *thread) |
| virtual void | run (void)=0 |
| void | start (void) |
| void | sync (void) |
| void | terminate (void) |
| Thread (int pri=0, size_t stack=0) | |
Public Member Functions inherited from ost::TTYStream | |
| void | interactive (bool flag) |
| Set tty mode to buffered or "interactive". | |
| bool | isPending (Pending pend, timeout_t timeout=ucommon::Timer::inf) |
| Get the status of pending operations. | |
| void | setTimeout (timeout_t to) |
| Set the timeout control. | |
| int | sync (void) |
| Flushes the stream input and out buffers, writes pending output. | |
| TTYStream (char *filename, timeout_t to=0) | |
| Create and open a tty serial port. | |
| virtual | ~TTYStream () |
| End the tty stream and cleanup. | |
Public Member Functions inherited from ost::Serial | |
| int | getBufferSize (void) |
| Get the "buffer" size for buffered operations. | |
| Error | getErrorNumber (void) |
| Often used by a "catch" to fetch the last error of a thrown serial. | |
| char * | getErrorString (void) |
| Often used by a "catch" to fetch the user set error string of a thrown serial. | |
| Serial & | operator= (Serial &from) |
| Serial ports may also be duplecated by the assignment operator. | |
| void | sendBreak (void) |
| Send the "break" signal. | |
| Error | setCharBits (int bits) |
| Set character size. | |
| Error | setFlowControl (Flow flow) |
| Set flow control. | |
| Error | setParity (Parity parity) |
| Set parity mode. | |
| Error | setSpeed (unsigned long speed) |
| Set serial port speed for both input and output. | |
| Error | setStopBits (int bits) |
| Set number of stop bits. | |
| void | toggleDTR (timeout_t millisec) |
| Set the DTR mode off momentarily. | |
| virtual | ~Serial () |
| The serial base class may be "thrown" as a result on an error, and the "catcher" may then choose to destory the object. | |
Additional Inherited Members | |
Public Types inherited from ost::Thread | |
| enum | Throw { throwNothing, throwObject, throwException } |
| How to raise error. | |
| typedef enum ost::Thread::Throw | Throw |
| How to raise error. | |
Public Types inherited from ost::Serial | |
| 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 |
Static Public Member Functions inherited from ost::Thread | |
| static Thread * | get (void) |
| static Throw | getException (void) |
| Get exception mode of the current thread. | |
| static void | setException (Throw mode) |
| Set exception mode of the current thread. | |
| static void | sleep (timeout_t msec=ucommon::Timer::inf) |
| static void | yield (void) |
Protected Member Functions inherited from ucommon::JoinableThread | |
| void | background (void) |
| Start execution of child context as background thread. | |
| bool | isRunning (void) |
| Check if running. | |
| void | start (int priority=0) |
| Start execution of child context. | |
| void | join (void) |
| Join thread with parent. | |
| JoinableThread (size_t size=0) | |
| Create a joinable thread with a known context stack size. | |
| virtual | ~JoinableThread () |
| Delete child thread. | |
Protected Member Functions inherited from ost::TTYStream | |
| void | allocate (void) |
| Used to allocate the buffer space needed for iostream operations. | |
| void | endStream (void) |
| Used to terminate the buffer space and clean up the tty connection. | |
| int | overflow (int ch) |
| This streambuf method is used to write the output buffer through the established tty port. | |
| 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. | |
| int | underflow (void) |
| This streambuf method is used to load the input buffer through the established tty serial port. | |
Protected Attributes inherited from ost::TTYStream | |
| char * | gbuf |
| char * | pbuf |
| timeout_t | timeout |
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.
| ost::TTYSession::TTYSession | ( | char * | name, |
| int | pri = 0, |
||
| int | stack = 0 |
||
| ) |
Create TTY stream that will be managed by it's own thread.
| name | of tty device to open. |
| pri | execution priority. |
| stack | allocation needed on some platforms. |
1.8.1.2