Public Types |
| enum | State { stOpen,
stClosed
} |
| | the states in which a SerialPort can be. More...
|
| enum | PurgeFlags { purgeInput = pal::serial::purgeInput,
purgeOutput = pal::serial::purgeOutput
} |
| | purge buffer flags. More...
|
| enum | ModemStatusFlags { mstatusDSR = pal::serial::mstatusDSR,
mstatusCTS = pal::serial::mstatusCTS,
mstatusDCD = pal::serial::mstatusDCD,
mstatusRNG = pal::serial::mstatusRNG
} |
| | modem status flags. More...
|
Public Methods |
| | SerialPort () throw () |
| | construct an closed serial port object. More...
|
| | SerialPort (string name) |
| | construct an opened serial port object. More...
|
| virtual | ~SerialPort () throw () |
| virtual char | pop () |
| virtual void | resetInput () |
| virtual bool | hasMore () const |
| virtual long | read (char *buffer, long count, bool bWaitAll=true) |
| virtual void | push (const char &value) |
| virtual void | resetOutput () |
| virtual bool | acceptMore () const |
| virtual void | flush () |
| virtual long | write (const char *buffer, long count, bool bWaitAll=true) |
| virtual void | open (string name) |
| | open serial port. More...
|
| virtual void | close () |
| | close the port. More...
|
| virtual long | availableCount () const |
| | return the number of bytes available in the input buffer. More...
|
| virtual void | setup (string settings) |
| | set serial port settings (baud rate, parity, ...). More...
|
| virtual void | setHardwareFlowControl (bool bEnable) |
| | enable/disable hardware flow control (CTS/RTS). More...
|
| virtual void | setSoftwareFlowControl (bool bEnable, char Xon=0x11, char Xoff=0x13) |
| | enable/disable software flow control (XON/XOFF). More...
|
| virtual void | setReadTimeout (long timeout) |
| | set input timeouts. More...
|
| virtual void | setBlockingRead (bool bBlocking) |
| | enable/disable blocking read. More...
|
| virtual void | sendBreak () |
| | send a 500ms break. More...
|
| virtual DWord | modemStatus () const |
| | return modem status bits. More...
|
| virtual void | setDTR (bool bEnable) |
| | enable/disable DTR. More...
|
| virtual void | setRTS (bool bEnable) |
| | enable/disable RTS. More...
|
| virtual State | state () const throw () |
| | return current SerialPort state. More...
|
Protected Methods |
| virtual void | testState (string location, int s1, int s2=-1, int s3=-1, int s4=-1) const |
Protected Attributes |
| pal::serial::Handle | m_handle |
| pal::serial::PortSettings | m_originalSettings |
| State | m_state |