16 #ifndef COMMUNICATION_HH
17 #define COMMUNICATION_HH
19 #include <QSerialPort>
The class connecting main application and serial port.
const FrameBuffer & getFrameBuffer() const
Get a unmodifiable frame from the circular buffer.
void receiveData()
Receive line one by one from the serial device in loop until end of communication.
std::string _deviceName
Serial device name.
FrameBuffer & useFrameBuffer()
Get a modifiable frame from the circular buffer.
bool closeSerialPort()
Close the serial port.
QSerialPort * _device
Serial device handle.
bool _continue
Identifier whether to continue communication with serial device.
const std::string & getDeviceName() const
Get the serial device name.
void setDevice(QSerialPort *device)
Set a new handle to the serial device.
void setDeviceName(const std::string &name)
Set the serial device name.
bool openSerialPort()
Wrapper function for opening a serial port.
void endCommunication()
Set the end of communication flag to end communication.
bool isOpen() const
Check if the serial port is open.
~Communication()=default
Destroy the Communication object.
bool toContinue() const
Check wether to continue communication with the serial device.
Communication()=default
Construct a new Communication object.
FrameBuffer _frame
Circular buffer for frames.
bool _opened
Identifier whether serial device is open.
Class implementing circular buffer.
FrameBuffer class declaration.