The class connecting main application and serial port.
More...
#include <communication.hh>
Contain handle to the serial port device and circular buffer which store individual frames from device.
Definition at line 29 of file communication.hh.
◆ Communication()
Communication::Communication |
( |
| ) |
|
|
default |
◆ ~Communication()
Communication::~Communication |
( |
| ) |
|
|
default |
◆ closeSerialPort()
bool Communication::closeSerialPort |
( |
| ) |
|
- Returns
- Identifier wether the serial port was closed successfully.
- Return values
-
true | Serial port closed successfully. |
false | Serial port closed incorrectly. |
Definition at line 42 of file communication.cpp.
◆ endCommunication()
void Communication::endCommunication |
( |
| ) |
|
|
inline |
◆ getDeviceName()
const std::string& Communication::getDeviceName |
( |
| ) |
const |
|
inline |
◆ getFrameBuffer()
const FrameBuffer& Communication::getFrameBuffer |
( |
| ) |
const |
|
inline |
- Returns
- Immutable reference to the one frame from buffer.
Definition at line 117 of file communication.hh.
◆ isOpen()
bool Communication::isOpen |
( |
| ) |
const |
|
inline |
- Returns
- Identifier wether the serial port is open.
- Return values
-
true | Serial port is open. |
false | Serial port is closed. |
Definition at line 105 of file communication.hh.
◆ openSerialPort() [1/2]
bool Communication::openSerialPort |
( |
| ) |
|
|
inline |
◆ openSerialPort() [2/2]
bool Communication::openSerialPort |
( |
const char * |
serialPort | ) |
|
Set the serial port parameters and open it in read only mode.
- Parameters
-
[in] | serialPort | The serial port name. |
- Returns
- Identifier wether the serial port was opened successfully.
- Return values
-
true | Serial port opened successfully. |
false | Serial port opened incorrectly. |
Definition at line 21 of file communication.cpp.
◆ receiveData()
void Communication::receiveData |
( |
| ) |
|
◆ setDevice()
void Communication::setDevice |
( |
QSerialPort * |
device | ) |
|
|
inline |
- Parameters
-
[in] | device | Handle to a new serial device. |
Definition at line 71 of file communication.hh.
◆ setDeviceName()
void Communication::setDeviceName |
( |
const std::string & |
name | ) |
|
|
inline |
- Parameters
-
[in] | name | New name of the serial device. |
Definition at line 57 of file communication.hh.
◆ toContinue()
bool Communication::toContinue |
( |
| ) |
const |
|
inline |
- Returns
- Identifier wether to continue communication.
- Return values
-
true | Continue communication. |
false | End communication. |
Definition at line 125 of file communication.hh.
◆ useFrameBuffer()
- Returns
- Mutable reference to the one frame from buffer.
Definition at line 111 of file communication.hh.
◆ _continue
bool Communication::_continue = true |
|
private |
◆ _device
QSerialPort* Communication::_device = nullptr |
|
private |
◆ _deviceName
std::string Communication::_deviceName |
|
private |
◆ _frame
◆ _opened
bool Communication::_opened = false |
|
private |
The documentation for this class was generated from the following files: