Thunderbots Project
Loading...
Searching...
No Matches
UartCommunication Class Referenceabstract
Inheritance diagram for UartCommunication:

Public Types

enum  FlushType { flush_receive = TCIFLUSH , flush_send = TCOFLUSH , flush_both = TCIOFLUSH }
 

Public Member Functions

 UartCommunication (const UartCommunication &)=delete
 
UartCommunicationoperator= (const UartCommunication &)=delete
 
virtual bool serialWrite (const std::vector< unsigned char > &write_val)=0
 
virtual std::vector< unsigned char > serialRead (size_t num_read_bytes)=0
 
virtual bool flushSerialPort (FlushType flush_type)=0
 

Member Function Documentation

◆ flushSerialPort()

virtual bool flushSerialPort ( FlushType  flush_type)
pure virtual

Flushes serial port data

Parameters
flush_typeenum that sets the data to be flushed (read, write, or both)
Returns
true upon success, false otherwise

Implemented in BoostUartCommunication.

◆ serialRead()

virtual std::vector< unsigned char > serialRead ( size_t  num_read_bytes)
pure virtual

reads a given number of bytes from UART receive buffer

Parameters
num_read_bytesthe number of bytes to read
Returns
the values read

Implemented in BoostUartCommunication.

◆ serialWrite()

virtual bool serialWrite ( const std::vector< unsigned char > &  write_val)
pure virtual

writes write_val into UART transmit buffer

Parameters
write_valvalues to be written
Returns
true upon success, false otherwise

Implemented in BoostUartCommunication.


The documentation for this class was generated from the following file: