#include <GPSProtocolRuntime.h>
Public Member Functions | |
| GPSProtocolRuntime (const GPSReceiverFamily &family, GPSRuntimeIO io, GPSRuntimeObserver observer={}) | |
| Creates the family's protocol with its factory. | |
| GPSProtocolRuntime (const GPSReceiverFamily &family, std::unique_ptr< GPSFamilyProtocol > protocol, GPSRuntimeIO io, GPSRuntimeObserver observer={}) | |
| Hosts protocol, for families configured by the caller such as test doubles. | |
| ~GPSProtocolRuntime () | |
| bool | configure (const GPSConfig &config, unsigned &baud) |
| bool | probe (std::chrono::milliseconds budget) |
| GPSReceiveUpdates | receive (std::chrono::milliseconds timeout) |
| bool | armDecodeOnly (const GPSConfig &config) |
| bool | armNavigationDecode (GPSNavigationDecode decode={}) |
| GPSEventBatch | decode (std::span< const uint8_t > bytes) |
| Decodes bytes without I/O or observer callbacks. | |
| GPSReceiveUpdates | consume (std::span< const uint8_t > bytes) |
| Decodes bytes and delivers their batch to the observer. An empty span flushes. | |
| GPSReceiveUpdates | consumeFrame (const GPSFrame &frame) |
| Decodes one frame another stream framed and delivers its batch to the observer, without flushing. | |
| bool | receiverReady () const |
| QString | identity () const |
| Model and firmware reported during configuration, trimmed; empty when unknown. | |
| GPSProtocolError | error () const |
| const QString & | errorDetail () const |
| const GPSReceiverFamily & | family () const |
| GPSFamilyProtocol & | protocol () |
| GPSStreamDemux & | stream () |
| GPSLogCategory | logCategory () const |
| The family's logging category, or the runtime's when the family has none. | |
Friends | |
| class | GPSCommandChannel |
Hosts one receiver family on a blocking transport. It owns the family protocol, the stream demultiplexer, the decode context that collects events, and the command channel with its deadlines, evidence and sticky failure. configure(), probe() and receive() run the family's code to completion on the caller thread; its channel operations block on GPSRuntimeIO.
Definition at line 47 of file GPSProtocolRuntime.h.
| GPSProtocolRuntime::GPSProtocolRuntime | ( | const GPSReceiverFamily & | family, |
| GPSRuntimeIO | io, | ||
| GPSRuntimeObserver | observer = {} ) |
Creates the family's protocol with its factory.
Definition at line 13 of file GPSProtocolRuntime.cc.
References family(), and GPSProtocolRuntime().
Referenced by GPSProtocolRuntime(), and ~GPSProtocolRuntime().
| GPSProtocolRuntime::GPSProtocolRuntime | ( | const GPSReceiverFamily & | family, |
| std::unique_ptr< GPSFamilyProtocol > | protocol, | ||
| GPSRuntimeIO | io, | ||
| GPSRuntimeObserver | observer = {} ) |
Hosts protocol, for families configured by the caller such as test doubles.
Definition at line 17 of file GPSProtocolRuntime.cc.
References family(), protocol(), and stream().
|
default |
References decode(), and GPSProtocolRuntime().
|
nodiscard |
Prepares decode() and consume() for traffic from a receiver configured with config, without I/O (GPSFamilyProtocol::armDecodeOnly()). config is valid for the family, as GPSDriver::configure() requires.
Definition at line 101 of file GPSProtocolRuntime.cc.
| bool GPSProtocolRuntime::armNavigationDecode | ( | GPSNavigationDecode | decode = {} | ) |
Prepares decode() and consume() for the navigation output of a receiver configured elsewhere, without I/O (GPSFamilyProtocol::armNavigationDecode()).
Definition at line 109 of file GPSProtocolRuntime.cc.
References decode().
|
nodiscard |
Configures the receiver after clearing any sticky failure. A zero baud requests detection and returns the detected rate. A command still pending at the end is retired as Written, and a successful configuration flushes once more so a fixed-base or survey-start event is delivered without another read.
Definition at line 59 of file GPSProtocolRuntime.cc.
References consume(), GPSConfig::detectedBaud, and Written.
| GPSReceiveUpdates GPSProtocolRuntime::consume | ( | std::span< const uint8_t > | bytes | ) |
Decodes bytes and delivers their batch to the observer. An empty span flushes.
Definition at line 127 of file GPSProtocolRuntime.cc.
References decode().
Referenced by configure().
| GPSReceiveUpdates GPSProtocolRuntime::consumeFrame | ( | const GPSFrame & | frame | ) |
Decodes one frame another stream framed and delivers its batch to the observer, without flushing.
Definition at line 132 of file GPSProtocolRuntime.cc.
|
nodiscard |
Decodes bytes without I/O or observer callbacks.
Definition at line 114 of file GPSProtocolRuntime.cc.
Referenced by armNavigationDecode(), consume(), and ~GPSProtocolRuntime().
|
inlinenodiscard |
Definition at line 98 of file GPSProtocolRuntime.h.
|
inlinenodiscard |
Definition at line 100 of file GPSProtocolRuntime.h.
|
inlinenodiscard |
Definition at line 102 of file GPSProtocolRuntime.h.
Referenced by GPSProtocolRuntime(), and GPSProtocolRuntime().
|
nodiscard |
Model and firmware reported during configuration, trimmed; empty when unknown.
Definition at line 156 of file GPSProtocolRuntime.cc.
|
nodiscard |
The family's logging category, or the runtime's when the family has none.
Definition at line 54 of file GPSProtocolRuntime.cc.
|
nodiscard |
Runs the family's identity probe (GPSFamilyProtocol::probe()) within budget at the link's current rate, after clearing any sticky failure.
Definition at line 78 of file GPSProtocolRuntime.cc.
References Written.
Referenced by GPSReceiverDetector::detect().
|
inlinenodiscard |
Definition at line 104 of file GPSProtocolRuntime.h.
Referenced by GPSProtocolRuntime().
| GPSReceiveUpdates GPSProtocolRuntime::receive | ( | std::chrono::milliseconds | timeout | ) |
One streaming receive of up to timeout, including the family's streaming services. Failures are reported through error().
Definition at line 93 of file GPSProtocolRuntime.cc.
|
nodiscard |
Definition at line 151 of file GPSProtocolRuntime.cc.
|
inlinenodiscard |
Definition at line 106 of file GPSProtocolRuntime.h.
Referenced by GPSProtocolRuntime().
|
friend |
Definition at line 112 of file GPSProtocolRuntime.h.
References GPSCommandChannel.
Referenced by GPSCommandChannel.