#include <LOW_portSerial.h>
Inheritance diagram for LOW_portSerial:
Public Types | |
enum | flowControl_t { none_flowControl, xonxoff_flowControl, rtscts_flowControl } |
Serial flow control type. More... | |
enum | dataBitsSite_t { bit5_size, bit6_size, bit7_size, bit8_size } |
Number of data bits type. More... | |
enum | parity_t { no_parity, odd_parity, even_parity } |
Parity control type. More... | |
enum | stopBits_t { bit1_stopBit, bit2_stopBit } |
Number of stop bits type. More... | |
enum | speed_t { B50_speed, B75_speed, B110_speed, B134_speed, B150_speed, B200_speed, B300_speed, B600_speed, B1200_speed, B1800_speed, B2400_speed, B4800_speed, B9600_speed, B19200_speed, B38400_speed, B57600_speed, B115200_speed, B10472_speed } |
Serial speed control type. More... | |
Public Member Functions | |
class_DERIVE_FROM_EXCEPTION (portSerial_error, LOW_exception) | |
Exception base class for all exceptions thrown by LOW_portSerial. | |
virtual | ~LOW_portSerial () |
Destructor. | |
virtual void | tty_configure (const flowControl_t inFlowCtl, const dataBitsSite_t inDataBits, const parity_t inParity, const stopBits_t inStopBits, const speed_t inSpeed)=0 |
Configure the serial port. | |
virtual void | tty_flush (const bool inFlushIn=true, const bool inFlushOut=true)=0 |
Flushs serial input and/or output buffers. | |
virtual void | tty_break ()=0 |
Sends break signal. | |
virtual uint8_t | tty_readByte (const bool inTrashExtraReply=false, const unsigned int inSecTimeout=defaultTimeout)=0 |
Reads on byte from serial port. | |
virtual void | tty_read (byteVec_t &outReadBytes, const bool inTrashExtraReply=false, const unsigned int inSecTimeout=defaultTimeout)=0 |
Reads multiple bytes from serial port. | |
virtual void | tty_write (const uint8_t inWriteByte)=0 |
Writes one byte to serial port. | |
virtual void | tty_write (const byteVec_t &inWriteBytes)=0 |
Writes multiple bytes to serial port. | |
Static Public Attributes | |
const unsigned int | defaultTimeout = 5 |
Each instance represents one serial port.
Specific platforms dereive their implementation classes from this class.
The instances are created by LOW_portSerialFactory, following the factory design pattern.
Note: There is no prescribed constructor. A class deriving from this one should have a constructor which only requires to specify the port, but no extra setup parameters for it.
This enables parts of your software to specify a serial port by creating an object, but without knowing the specific setup for it. This setup might be known then by other parts, which receive the object as port specification.
This class is thread-safe.
Definition at line 48 of file LOW_portSerial.h.
|
Number of data bits type.
Definition at line 79 of file LOW_portSerial.h. |
|
Serial flow control type.
Definition at line 76 of file LOW_portSerial.h. |
|
Parity control type.
Definition at line 82 of file LOW_portSerial.h. |
|
Serial speed control type.
Definition at line 88 of file LOW_portSerial.h. |
|
Number of stop bits type.
Definition at line 85 of file LOW_portSerial.h. |
|
Destructor.
Definition at line 27 of file LOW_portSerial.cpp. |
|
Exception base class for all exceptions thrown by LOW_portSerial.
|
|
Sends break signal. Abstract method to be implemented by derived class. Implemented in LOW_portSerial_Linux. Referenced by LOW_linkDS2480B::resetLinkAdapter(). |
|
Configure the serial port. Abstract method to be implemented by derived class.
Implemented in LOW_portSerial_Linux. Referenced by LOW_linkPassiveSerial::resetBus(), LOW_linkPassiveSerial::resetLinkAdapter(), and LOW_linkDS2480B::resetLinkAdapter(). |
|
Flushs serial input and/or output buffers. Abstract method to be implemented by derived class.
Implemented in LOW_portSerial_Linux. Referenced by LOW_linkDS2480B::reset_cmd(), LOW_linkPassiveSerial::resetBus(), LOW_linkPassiveSerial::resetLinkAdapter(), LOW_linkDS2480B::resetLinkAdapter(), LOW_linkPassiveSerial::touchBit(), LOW_linkDS2480B::~LOW_linkDS2480B(), and LOW_linkPassiveSerial::~LOW_linkPassiveSerial(). |
|
Reads multiple bytes from serial port. The desired number of bytes to read is specified by the preset length of the vector parameter. Abstract method to be implemented by derived class.
Implemented in LOW_portSerial_Linux. Referenced by LOW_linkDS2480B::touchBlock(). |
|
Reads on byte from serial port. Abstract method to be implemented by derived class.
Implemented in LOW_portSerial_Linux. Referenced by LOW_linkDS2480B::pulse_cmd(), LOW_linkDS2480B::pulse_cmd_manual(), LOW_linkDS2480B::readConfigValue(), LOW_linkDS2480B::reset_cmd(), LOW_linkPassiveSerial::resetBus(), LOW_linkDS2480B::singleBit_cmd(), LOW_linkPassiveSerial::touchBit(), LOW_linkDS2480B::touchByte(), and LOW_linkDS2480B::writeConfigValue(). |
|
Writes multiple bytes to serial port. The desired number of bytes to write is specified by the preset length of the vector parameter. Abstract method to be implemented by derived class.
Implemented in LOW_portSerial_Linux. |
|
Writes one byte to serial port. Abstract method to be implemented by derived class.
Implemented in LOW_portSerial_Linux. Referenced by LOW_linkDS2480B::pulse_cmd(), LOW_linkDS2480B::pulse_cmd_manual(), LOW_linkDS2480B::readConfigValue(), LOW_linkDS2480B::reset_cmd(), LOW_linkPassiveSerial::resetBus(), LOW_linkDS2480B::resetLinkAdapter(), LOW_linkDS2480B::searchAccelCtrl_cmd(), LOW_linkDS2480B::setMode(), LOW_linkDS2480B::singleBit_cmd(), LOW_linkPassiveSerial::touchBit(), LOW_linkDS2480B::touchBlock(), LOW_linkDS2480B::touchByte(), and LOW_linkDS2480B::writeConfigValue(). |
|
Definition at line 67 of file LOW_portSerial.h. |