|
|
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) |
Construct a tty serial port for a named serial device.
Parameters:
svc | pool thread object. |
name | of tty port. |
~SerialPort () |
Disconnect the Serial Port from the service pool thread and shutdown the port.
void Expired (void) |
Called by the service thread when the objects timer has expired.
void Pending (void) |
Called by the service thread when input data is pending for this tty port. Effected by setPacketInput and by setLineInput.
void Disconnect (void) |
Called by the service thread when an exception has occured such as a hangup.
inline int Output (void *buf, int len) |
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:
address | of buffer to send. |
len | of bytes to send. |
Returns: number of bytes send.
inline int Input (void *buf, int len) |
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:
address | of buffer to input. |
len | of 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:
timeout | in 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