|
| enum | FlushType { flush_receive = TCIFLUSH
, flush_send = TCOFLUSH
, flush_both = TCIOFLUSH
} |
| |
◆ BoostUartCommunication()
constructs and opens a serial connection with the given device port settings used: 8 bit data, No flow control, No parity, 1 stop bit
- Parameters
-
| baud_rate | the desired baud rate of the connection |
| device_serial_port | the serial port that we want to communicate with |
- Exceptions
-
| boost::exception | if port could not be opened |
◆ flushSerialPort()
| bool flushSerialPort |
( |
FlushType |
flush_type | ) |
|
|
overridevirtual |
Flushes serial port data
- Parameters
-
| flush_type | enum that sets the data to be flushed (read, write, or both) |
- Returns
- true upon success, false otherwise
Implements UartCommunication.
◆ operator<<()
| bool operator<< |
( |
const std::vector< unsigned char > & |
write_val | ) |
|
Stream output operator, writes to serial port, blocking thread
- Parameters
-
- Returns
- true if succeeded, false otherwise
- Exceptions
-
| boost::exception | upon error |
◆ serialRead()
| std::vector< unsigned char > serialRead |
( |
size_t |
num_read_bytes | ) |
|
|
overridevirtual |
Reads a given number of bytes from serial port until num_read_bytes is read or error occurs. Blocks current thread.
- Parameters
-
| num_read_bytes | number of bytes that should be read |
- Returns
- vector of size num_read_bytes with read data
- Exceptions
-
| boost:exception | upon error during read |
Implements UartCommunication.
◆ serialWrite()
| bool serialWrite |
( |
const std::vector< unsigned char > & |
write_val | ) |
|
|
overridevirtual |
Writes into serial port. Blocks current thread.
- Parameters
-
| write_val | buffer that will be written to serial port |
- Returns
- true upon success, false otherwise
- Exceptions
-
| boost::exception | upon error during write |
Implements UartCommunication.
The documentation for this class was generated from the following files: