7 #ifndef SERIALINTERFACE_H 8 #define SERIALINTERFACE_H 10 #include <serial/serial.h> 83 void send(std::string& message);
90 void read(std::string& message, std::string& delimiter);
122 #endif // SERIALINTERFACE_H static SerialInterface & instance()
Returns a singleton auf this class.
serial::Serial serialConnection
unsigned int serialTimeout
void setSerialTimeout(unsigned int serialTimeout)
Setter for the serial timeout.
void setMaxLineLength(unsigned int maxLineLength)
Setter for the maximum line length.
SerialInterface & operator=(const SerialInterface &)
SerialInterface default assign operator.
void disconnect()
try to close the connection to the serial device
std::string serialDevicesFolder
unsigned int maxLineLength
void setBaudRate(unsigned int baudRate)
Setter for the baudrate, which defines the bandwith of the communication.
void findDeviceName(std::string &deviceName)
~SerialInterface()
SerialInterface default destructor.
SerialInterface()
SerialInterface default constructor.
void setDeviceTag(const std::string &deviceTag)
Setter for the device tag, which is an identifier a the connected serial device.
void connect()
try to open a connection to the serial device
void setSerialDevicesFolder(const std::string &serialDevicesFolder)
Setter for the path to the devices folder.
void send(std::string &message)
try to send a message to the serial device
The SerialInterface class provides an interface to a connected serial device.
void read(std::string &message, std::string &delimiter)
read a message from the serial input buffer