Base class for interfacing with sensors over a serial port (UART/RS-232).
More...
#include <serialsensor.hh>
|
virtual void | readData (void)=0 |
| Slot to read in data over serial and parse complete packets.
|
|
Base class for interfacing with sensors over a serial port (UART/RS-232).
dfti::SerialSensor::SerialSensor |
( |
Settings * |
_settings, |
|
|
QObject * |
_parent = nullptr |
|
) |
| |
|
inlineexplicit |
Constructor.
- Parameters
-
_settings | Pointer to settings object. |
_parent | Pointer to parent QObject. |
void dfti::SerialSensor::configureSerial |
( |
QString |
_portName | ) |
|
Set the serial port parameters.
- Parameters
-
_portName | The serial port name. |
bool dfti::SerialSensor::isOpen |
( |
void |
| ) |
|
Returns true if the serial port is open.
- Returns
- True if the serial port is open.
void dfti::SerialSensor::open |
( |
void |
| ) |
|
|
virtual |
Opens the serial port.
Since we may not initially know which serial port corresponds to which sensor, we need to wait to open the serial port associated with the sensor until we know which port it is. Once we do, we call this open method to start reading the serial port.
Reimplemented in dfti::Autopilot.
void dfti::SerialSensor::setBaudRate |
( |
quint32 |
rate | ) |
|
Set the serial port baud rate.
- Parameters
-
rate | The serial port baud rate. Must be one of 57600, 115200. |
The documentation for this class was generated from the following files: