class SerialPort

base class for thread pool serviced serial I/O. More...

Definition#include <serial.h>
InheritsSerial, TimerPort
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

The serial port is an internal class which is attached to and then serviced by a specified SerialService thread. Derived versions of this class offer specific functionality such as serial integration protocols.

SerialPort (SerialService *svc, const char *name)
[protected]

Construct a tty serial port for a named serial device.

Parameters:
svcpool thread object.
nameof tty port.

~SerialPort ()
[protected virtual]

Disconnect the Serial Port from the service pool thread and shutdown the port.

void setDetectPending ( bool )
[protected]

Used to indicate if the service thread should monitor pending data for us.

bool getDetectPending ( void )
[protected const]

Get the current state of the DetectPending flag.

void setDetectOutput ( bool )
[protected]

Used to indicate if output ready monitoring should be performed by the service thread.

bool getDetectOutput ( void )
[protected const]

Get the current state of the DetectOutput flag.

void Expired (void)
[protected virtual]

Called by the service thread when the objects timer has expired.

void Pending (void)
[protected virtual]

Called by the service thread when input data is pending for this tty port. Effected by setPacketInput and by setLineInput.

void Disconnect (void)
[protected virtual]

Called by the service thread when an exception has occured such as a hangup.

inline int Output (void *buf, int len)
[protected]

Transmit "send" data to the serial port. This is not public since it's meant to support internal protocols rather than direct public access to the device.

Parameters:
addressof buffer to send.
lenof bytes to send.

Returns: number of bytes send.

void Output (void)
[protected virtual]

Perform when output is available for sending data.

inline int Input (void *buf, int len)
[protected]

Receive "input" for pending data from the serial port. This is not a public member since it's meant to support internal protocols rather than direct external access to the device.

Parameters:
addressof buffer to input.
lenof input buffer used.

Returns: number of bytes received.

void setTimer (timeout_t timeout = 0)

Derived setTimer to notify the service thread pool of changes in expected timeout. This allows SerialService to reschedule all timers.

Parameters:
timeoutin milliseconds.

Reimplemented from TimerPort

void incTimer (timeout_t timeout)

Derived incTimer to notify the service thread pool of a change in expected timeout. This allows SerialService to reschedule all timers.

Reimplemented from TimerPort