|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <GPSTransport.h>
Inheritance diagram for GPSTransport:Public Member Functions | |
| GPSTransport (GPSCancelToken cancelToken) | |
| virtual | ~GPSTransport () |
| virtual GPSOpenResult | open ()=0 |
| virtual bool | fatalError () const =0 |
| bool | isCancelled () const |
| const GPSCancelToken & | cancelToken () const |
| virtual unsigned | fixedBaudrate () const |
| Nonzero when the link cannot follow baud-rate changes (for example, a serial bridge). | |
| virtual GPSReadResult | read (std::span< uint8_t > buffer, std::chrono::milliseconds timeout)=0 |
| virtual std::chrono::milliseconds | configurationWriteTimeout () const |
| GPSWriteResult | write (QByteArrayView bytes, QDeadlineTimer deadline) |
| virtual bool | setBaudrate (unsigned baudrate) |
Static Public Attributes | |
| static constexpr unsigned | BRIDGE_BAUDRATE = 115200 |
| static constexpr qint64 | READ_BUFFER_BYTES = 64 * 1024 |
| static constexpr qint64 | WRITE_BUFFER_BYTES = 4 * 1024 |
| Bytes a link queues for writing at once. | |
Protected Member Functions | |
| virtual GPSWriteResult | writeData (QByteArrayView bytes, QDeadlineTimer deadline)=0 |
| Receives non-empty bytes and an unexpired, capped deadline that implementations must honor. | |
Byte link the GPS driver reads and writes through. Implemented by the owner of the physical connection and consumed by GPSDriver, keeping the native protocol drivers decoupled from the concrete transport. Construct, use, and destroy on one owner thread. Blocking waits dispatch events: callbacks must not reenter, reopen, or destroy the transport during a call. Other threads cancel through the GPSCancelSource that issued the construction token.
Definition at line 75 of file GPSTransport.h.
|
explicit |
Definition at line 10 of file GPSTransport.cc.
|
virtual |
Definition at line 16 of file GPSTransport.cc.
|
inline |
Definition at line 86 of file GPSTransport.h.
Referenced by GPSDriver::configure(), and GPSDeviceTransport::waitUntil().
|
virtual |
Reimplemented in TCPGPSTransport.
Definition at line 36 of file GPSTransport.cc.
Referenced by write().
|
pure virtual |
|
inlinevirtual |
Nonzero when the link cannot follow baud-rate changes (for example, a serial bridge).
Reimplemented in TCPGPSTransport, and UDPGPSTransport.
Definition at line 89 of file GPSTransport.h.
Referenced by GPSDriver::configure(), and setBaudrate().
|
inline |
Definition at line 84 of file GPSTransport.h.
References GPSCancelToken::isCancelled().
Referenced by SerialGPSTransport::open(), TCPGPSTransport::open(), UDPGPSTransport::open(), GPSDeviceTransport::read(), GPSDriver::receiveOutcome(), setBaudrate(), SerialGPSTransport::setBaudrate(), GPSDeviceTransport::waitForDevice(), SerialGPSTransport::waitReadable(), GPSDeviceTransport::waitUntil(), write(), and GPSDeviceTransport::writeData().
|
pure virtual |
Implemented in SerialGPSTransport, TCPGPSTransport, and UDPGPSTransport.
|
pure virtual |
A nonpositive timeout polls immediately available input. Failures never carry usable stream bytes. An empty buffer reports the failure of a failed link without reading.
Implemented in GPSDeviceTransport.
Referenced by GPSDriver::configure(), and GPSDriver::receiveOutcome().
|
virtual |
Sets the link baud rate. Returns true on success. By default only a healthy link's fixed rate succeeds, as a network bridge cannot change it. A refused rate leaves the link usable unless fatalError() reports otherwise.
Reimplemented in SerialGPSTransport.
Definition at line 41 of file GPSTransport.cc.
References fatalError(), fixedBaudrate(), and isCancelled().
Referenced by GPSDriver::configure().
| GPSWriteResult GPSTransport::write | ( | QByteArrayView | bytes, |
| QDeadlineTimer | deadline | ||
| ) |
Receiver configuration write under the command deadline, capped by configurationWriteTimeout(). Counts describe transport progress, never receiver acknowledgement. A failed operation that accepted bytes retires the connection; open a new session before writing again.
Definition at line 21 of file GPSTransport.cc.
References Cancelled, Completed, configurationWriteTimeout(), isCancelled(), TimedOut, and writeData().
Referenced by GPSDriver::configure().
|
protectedpure virtual |
Receives non-empty bytes and an unexpired, capped deadline that implementations must honor.
Implemented in GPSDeviceTransport, and UDPGPSTransport.
Referenced by write().
|
staticconstexpr |
Line rate that TCP and UDP links report. Drivers still program the receiver's serial port with it (UBX CFG-PRT sets UART1 to it), so the serial side of a network bridge and its receiver must run at this rate.
Definition at line 93 of file GPSTransport.h.
Referenced by TCPGPSTransport::fixedBaudrate(), and UDPGPSTransport::fixedBaudrate().
|
staticconstexpr |
Received bytes a link buffers before it stops taking more (TCP), retires the session (serial) or drops the oldest (UDP).
Definition at line 96 of file GPSTransport.h.
Referenced by SerialGPSTransport::open(), and TCPGPSTransport::open().
|
staticconstexpr |
Bytes a link queues for writing at once.
Definition at line 98 of file GPSTransport.h.
Referenced by GPSDeviceTransport::writeData().