QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSFamilyProtocol Class Referenceabstract

#include <GPSFamilyProtocol.h>

+ Inheritance diagram for GPSFamilyProtocol:

Public Member Functions

virtual ~GPSFamilyProtocol ()=default
 
virtual bool configure (GPSCommandChannel &channel, GPSConfig config, unsigned &baud)=0
 
virtual bool probe (GPSCommandChannel &channel)
 
virtual GPSReceiveUpdates onFrame (const GPSFrame &frame, GPSDecodeContext &context)=0
 
virtual void flush (GPSDecodeContext &context)
 Publishes time-driven output before each decode, such as expired epochs.
 
virtual bool receiverReady () const
 
virtual QString identity () const
 Model and firmware reported during configuration; empty when unknown.
 
virtual bool armDecodeOnly (const GPSConfig &config, GPSDecodeContext &context)
 
virtual bool armNavigationDecode (GPSNavigationDecode decode, GPSDecodeContext &context)
 
virtual GPSReceiveUpdates receive (GPSCommandChannel &channel, std::chrono::milliseconds timeout)
 One streaming receive. The default runs GPSCommandChannel::receiveCycle() and then the streaming services.
 
virtual bool completeReceiveCycle (GPSReceiveUpdates handled)
 
virtual std::chrono::milliseconds nextReadSlice (std::chrono::milliseconds timeout) const
 The longest single read in a receive cycle of timeout; the cycle deadline still bounds it.
 
virtual void serviceStreaming (GPSCommandChannel &channel)
 

Protected Member Functions

 GPSFamilyProtocol ()=default
 

Detailed Description

One receiver family's protocol: its decoding, configuration and streaming services. The runtime owns the I/O, framing, deadlines, command evidence and sticky failure, so implementations hold only receiver state.

Definition at line 189 of file GPSFamilyProtocol.h.

Constructor & Destructor Documentation

◆ ~GPSFamilyProtocol()

virtual GPSFamilyProtocol::~GPSFamilyProtocol ( )
virtualdefault

◆ GPSFamilyProtocol()

GPSFamilyProtocol::GPSFamilyProtocol ( )
protecteddefault

Member Function Documentation

◆ armDecodeOnly()

virtual bool GPSFamilyProtocol::armDecodeOnly ( const GPSConfig &  config,
GPSDecodeContext &  context 
)
inlinevirtual

Decode-only use, such as replaying a recording: leaves the decoder as a successful configure() with config would, without I/O or events.

Returns
false, as by default, when the family reports base status only after configuring a receiver, or cannot configure config.

Reimplemented in UBX::Protocol.

Definition at line 229 of file GPSFamilyProtocol.h.

References config.

◆ armNavigationDecode()

virtual bool GPSFamilyProtocol::armNavigationDecode ( GPSNavigationDecode  decode,
GPSDecodeContext &  context 
)
inlinevirtual

Decode-only use without a configuration, such as passive input or fuzzing: decodes the navigation output (positions, satellites, integrity) of a receiver configured elsewhere, as decode asks, without I/O or events.

Returns
false, as by default, when the family decodes that output without being armed.

Reimplemented in UBX::Protocol.

Definition at line 239 of file GPSFamilyProtocol.h.

◆ completeReceiveCycle()

virtual bool GPSFamilyProtocol::completeReceiveCycle ( GPSReceiveUpdates  handled)
inlinevirtual

Whether the current receive cycle has what it waits for, given the updates it accumulated so far. Checked before every read, including the first. The default returns after any update.

Reimplemented in UBX::Protocol.

Definition at line 251 of file GPSFamilyProtocol.h.

Referenced by GPSCommandChannel::receiveCycle().

◆ configure()

virtual bool GPSFamilyProtocol::configure ( GPSCommandChannel &  channel,
GPSConfig  config,
unsigned &  baud 
)
pure virtual

Configures the receiver. A zero baud requests detection; set it to the rate the link ends at. Any sticky failure has been cleared before this starts. A failed configuration records its reason with GPSCommandChannel::failControl(), failSequence() or failNoAnswer() and returns false; GPSDriver logs it, so the family does not.

Returns
true when the receiver is ready.

Implemented in UBX::Protocol.

◆ flush()

virtual void GPSFamilyProtocol::flush ( GPSDecodeContext &  context)
inlinevirtual

Publishes time-driven output before each decode, such as expired epochs.

Reimplemented in GPSNMEAFamilyProtocol, and UBX::Protocol.

Definition at line 217 of file GPSFamilyProtocol.h.

◆ identity()

virtual QString GPSFamilyProtocol::identity ( ) const
inlinevirtual

Model and firmware reported during configuration; empty when unknown.

Reimplemented in UBX::Protocol.

Definition at line 224 of file GPSFamilyProtocol.h.

◆ nextReadSlice()

virtual std::chrono::milliseconds GPSFamilyProtocol::nextReadSlice ( std::chrono::milliseconds  timeout) const
inlinevirtual

The longest single read in a receive cycle of timeout; the cycle deadline still bounds it.

Reimplemented in UBX::Protocol.

Definition at line 254 of file GPSFamilyProtocol.h.

Referenced by GPSCommandChannel::receiveCycle().

◆ onFrame()

virtual GPSReceiveUpdates GPSFamilyProtocol::onFrame ( const GPSFrame &  frame,
GPSDecodeContext &  context 
)
pure virtual

Decodes one frame, publishing events to the context.

Returns
updates beyond the published events, such as protocol activity for an acknowledgement.

Implemented in GPSNMEAFamilyProtocol, and UBX::Protocol.

◆ probe()

virtual bool GPSFamilyProtocol::probe ( GPSCommandChannel &  channel)
inlinevirtual

Receiver detection's read-only identity query at the link's current rate (GPSReceiverDetector): sends it and waits for the answer, never changing receiver settings.

Returns
whether a receiver of this family answered, even one the family cannot configure; false, as by default, for a family without GPSReceiverFamily::baudCandidates, which detection never probes.

Reimplemented in UBX::Protocol.

Definition at line 206 of file GPSFamilyProtocol.h.

◆ receive()

GPSReceiveUpdates GPSFamilyProtocol::receive ( GPSCommandChannel &  channel,
std::chrono::milliseconds  timeout 
)
virtual

One streaming receive. The default runs GPSCommandChannel::receiveCycle() and then the streaming services.

Reimplemented in GPSNMEAFamilyProtocol.

Definition at line 209 of file GPSProtocolRuntime.cc.

References GPSCommandChannel::receiveCycle(), and GPSCommandChannel::serviceControls().

Referenced by GPSCommandChannel::receiveFor().

◆ receiverReady()

virtual bool GPSFamilyProtocol::receiverReady ( ) const
inlinevirtual

Whether the receiver runs as the latest configure() set it up, such as a base sending corrections; false before and while configuring. The runtime reports a receiver with a sticky failure as not ready.

Reimplemented in GPSNMEAFamilyProtocol, and UBX::Protocol.

Definition at line 221 of file GPSFamilyProtocol.h.

◆ serviceStreaming()

void GPSFamilyProtocol::serviceStreaming ( GPSCommandChannel &  channel)
virtual

Commands decoders scheduled while streaming, such as diagnostics polls, RTCM activation or disabling an unexpected message. Runs after each streaming receive under GPSCommandChannel::SERVICE_TIMEOUT.

Reimplemented in UBX::Protocol.

Definition at line 216 of file GPSProtocolRuntime.cc.

Referenced by GPSCommandChannel::serviceControls().


The documentation for this class was generated from the following files: