SerialPort
A light-weight C++ library for cross-platform serial communication.
|
An abstract base class defining the interface of all serial port implementations. More...
#include <interface.h>
Public Member Functions | |
Interface (const Settings &settings) | |
Interface (const std::string &port_name, int baud_rate, Parity parity=Parity::kNone, NumStopBits stop_bits=serial_port::NumStopBits::kOne, bool hardware_flow_control=false, unsigned long int timeout_s=0, unsigned long int timeout_ms=0) | |
Interface (Interface &&)=default | |
Interface & | operator= (Interface &&other)=default |
Interface (const Interface &)=delete | |
Interface & | operator= (const Interface &other)=delete |
virtual void | Open ()=0 |
virtual void | Close ()=0 |
virtual bool | IsOpen ()=0 |
const Settings & | GetSettings () const |
virtual unsigned long | NumBytesAvailable ()=0 |
virtual void | FlushBuffer () const =0 |
virtual unsigned long | ReadData (char *data, unsigned long num_bytes)=0 |
virtual std::string | ReadString () |
virtual unsigned long | WriteData (const char *data, unsigned long num_bytes)=0 |
virtual unsigned long | WriteString (const std::string &str) |
Protected Attributes | |
Settings | settings_ |
An abstract base class defining the interface of all serial port implementations.