#include <serchan.h>
Inheritance diagram for PSerialChannel:
Construction | |
enum | Parity { DefaultParity, NoParity, EvenParity, OddParity, MarkParity, SpaceParity } |
Configuration of serial port parity options. More... | |
enum | FlowControl { DefaultFlowControl, NoFlowControl, XonXoff, RtsCts } |
Configuration of serial port flow control options. More... | |
PSerialChannel () | |
Create a new serial channel object, but do not open it. | |
PSerialChannel (const PString &port, DWORD speed=0, BYTE data=0, Parity parity=DefaultParity, BYTE stop=0, FlowControl inputFlow=DefaultFlowControl, FlowControl outputFlow=DefaultFlowControl) | |
PSerialChannel (PConfig &cfg) | |
~PSerialChannel () | |
Close the serial channel on destruction. | |
Open functions | |
virtual BOOL | Open (const PString &port, DWORD speed=0, BYTE data=0, Parity parity=DefaultParity, BYTE stop=0, FlowControl inputFlow=DefaultFlowControl, FlowControl outputFlow=DefaultFlowControl) |
virtual BOOL | Open (PConfig &cfg) |
static PStringList | GetPortNames () |
Public Member Functions | |
BOOL | Close () |
Configuration functions | |
BOOL | SetSpeed (DWORD speed) |
DWORD | GetSpeed () const |
BOOL | SetDataBits (BYTE data) |
BYTE | GetDataBits () const |
BOOL | SetParity (Parity parity) |
Parity | GetParity () const |
BOOL | SetStopBits (BYTE stop) |
BYTE | GetStopBits () const |
BOOL | SetInputFlowControl (FlowControl flowControl) |
FlowControl | GetInputFlowControl () const |
BOOL | SetOutputFlowControl (FlowControl flowControl) |
FlowControl | GetOutputFlowControl () const |
virtual void | SaveSettings (PConfig &cfg) |
Status functions | |
void | SetDTR (BOOL state=TRUE) |
void | ClearDTR () |
void | SetRTS (BOOL state=TRUE) |
void | ClearRTS () |
void | SetBreak (BOOL state=TRUE) |
void | ClearBreak () |
BOOL | GetCTS () |
BOOL | GetDSR () |
BOOL | GetDCD () |
BOOL | GetRing () |
|
Configuration of serial port flow control options.
|
|
|
Create a new serial channel object, but do not open it.
|
|
Create a serial channal. The channel is opened it on the specified port and with the specified attributes.
|
|
Create a serial channal. The channel is opened using attributes obtained from standard variables in the configuration file. Note that it assumed that the correct configuration file section is already set.
|
|
Close the serial channel on destruction.
|
|
Clear the break condition of the serial port. This is equivalent to #SetBreak(FALSE)#. |
|
Clear the Data Terminal Ready signal of the serial port. This is equivalent to #SetDTR(FALSE)#. |
|
Clear the Request To Send signal of the serial port. This is equivalent to #SetRTS(FALSE)#. |
|
Close the channel, shutting down the link to the data source.
Reimplemented from PChannel. Reimplemented in PModem. |
|
Get the Clear To Send signal of the serial port.
|
|
Get the data bits (5, 6, 7 or 8) of the serial port.
|
|
Get the Data Carrier Detect signal of the serial port.
|
|
Get the Data Set Ready signal of the serial port.
|
|
Get the flow control (handshaking) protocol of the input to the serial port.
|
|
Get the flow control (handshaking) protocol of the output from the serial port.
|
|
Get the parity of the serial port.
|
|
Get a list of the available serial ports. This returns a set of platform dependent strings which describe the serial ports of the computer. For example under unix it may be "ttyS0", under MS-DOS or NT it would be "COM1" and for the Macintosh it could be "Modem".
|
|
Get the Ring Indicator signal of the serial port.
|
|
Get the speed (baud rate) of the serial channel.
|
|
Get the stop bits (1 or 2) of the serial port.
|
|
Open a serial channal. The channel is opened using attributes obtained from standard variables in the configuration file. Note that it assumed that the correct configuration file section is already set.
Reimplemented in PModem. |
|
Open a serial channal. The channel is opened it on the specified port and with the specified attributes.
Reimplemented in PModem. |
|
Save the current port settings into the configuration file. Note that it assumed that the correct configuration file section is already set.
Reimplemented in PModem. |
|
Set the break condition of the serial port.
|
|
Set the data bits (5, 6, 7 or 8) of the serial port.
|
|
Set the Data Terminal Ready signal of the serial port.
|
|
Set the flow control (handshaking) protocol of the input to the serial port.
|
|
Set the flow control (handshaking) protocol of the output to the serial port.
|
|
Set the parity of the serial port.
|
|
Set the Request To Send signal of the serial port.
|
|
Set the speed (baud rate) of the serial channel.
|
|
Set the stop bits (1 or 2) of the serial port.
|