|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <SerialGPSTransport.h>
Inheritance diagram for SerialGPSTransport:
Collaboration diagram for SerialGPSTransport:Public Member Functions | |
| SerialGPSTransport (QString device, const std::atomic_bool &requestStop) | |
| ~SerialGPSTransport () override | |
| bool | open () |
| bool | fatalError () const |
| True once the port hits an error the receive loop should stop retrying past. | |
| int | read (uint8_t *buffer, int length, int timeoutMs) override |
| int | write (const uint8_t *buffer, int length) override |
| Write length bytes. Returns bytes written, or -1 on error. | |
| bool | setBaudrate (unsigned baudrate) override |
| Set the link baud rate. Returns true on success. | |
Public Member Functions inherited from GPSTransport | |
| virtual | ~GPSTransport ()=default |
GPSTransport backed by a QSerialPort. Owns the port and must be constructed on the thread that pumps the driver — QSerialPort has thread affinity.
Definition at line 15 of file SerialGPSTransport.h.
| SerialGPSTransport::SerialGPSTransport | ( | QString | device, |
| const std::atomic_bool & | requestStop | ||
| ) |
Definition at line 17 of file SerialGPSTransport.cc.
|
overridedefault |
| bool SerialGPSTransport::fatalError | ( | ) | const |
True once the port hits an error the receive loop should stop retrying past.
Definition at line 56 of file SerialGPSTransport.cc.
References QSerialPort::NoError, and QSerialPort::TimeoutError.
| bool SerialGPSTransport::open | ( | ) |
Open the device, retrying briefly while it settles after startup. Aborts the retry promptly if requestStop is set, so a disconnect can't be stalled by it.
Definition at line 25 of file SerialGPSTransport.cc.
References QSerialPort::Baud9600, QSerialPort::Data8, QSerialPort::NoError, QSerialPort::NoFlowControl, QSerialPort::NoParity, QSerialPort::OneStop, and QSerialPort::PermissionError.
|
overridevirtual |
Read up to length bytes into buffer, waiting up to timeoutMs. Returns bytes read, 0 on timeout, <0 on error.
Implements GPSTransport.
Definition at line 63 of file SerialGPSTransport.cc.
|
overridevirtual |
Set the link baud rate. Returns true on success.
Implements GPSTransport.
Definition at line 95 of file SerialGPSTransport.cc.
|
overridevirtual |
Write length bytes. Returns bytes written, or -1 on error.
Implements GPSTransport.
Definition at line 76 of file SerialGPSTransport.cc.