QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UBX::Protocol Class Referencefinal

#include <UBXProtocol.h>

+ Inheritance diagram for UBX::Protocol:
+ Collaboration diagram for UBX::Protocol:

Public Member Functions

bool configure (GPSCommandChannel &channel, GPSConfig config, unsigned &baud) override
 
bool probe (GPSCommandChannel &channel) override
 The MON-VER poll Protocol::configure() identifies receivers with, under the same label and timeout.
 
GPSReceiveUpdates onFrame (const GPSFrame &frame, GPSDecodeContext &context) override
 
void flush (GPSDecodeContext &context) override
 Publishes epochs past their deadline.
 
bool receiverReady () const override
 
QString identity () const override
 Model and firmware reported during configuration; empty when unknown.
 
bool armDecodeOnly (const GPSConfig &config, GPSDecodeContext &context) override
 The decoder state a successful configure() leaves: navigation, survey and corrections decoding.
 
bool armNavigationDecode (GPSNavigationDecode decode, GPSDecodeContext &context) override
 
bool completeReceiveCycle (GPSReceiveUpdates handled) override
 Whether a receive cycle has what it waits for: a pending readback, or else a navigation update.
 
std::chrono::milliseconds nextReadSlice (std::chrono::milliseconds timeout) const override
 Reads briefly once part of an epoch has arrived, as the rest follows back to back.
 
void serviceStreaming (GPSCommandChannel &channel) override
 RTCM activation after survey-in and disabling unexpected output, as decoding requested.
 
- Public Member Functions inherited from GPSFamilyProtocol
virtual ~GPSFamilyProtocol ()=default
 
virtual GPSReceiveUpdates receive (GPSCommandChannel &channel, std::chrono::milliseconds timeout)
 One streaming receive. The default runs GPSCommandChannel::receiveCycle() and then the streaming services.
 

Static Public Attributes

static constexpr std::array NAVIGATION_MESSAGES
 
static constexpr std::chrono::seconds REPEATED_WARNING_INTERVAL {60}
 A receiver warning or error repeated within this interval is logged at debug level.
 

Additional Inherited Members

- Protected Member Functions inherited from GPSFamilyProtocol
 GPSFamilyProtocol ()=default
 

Detailed Description

The u-blox family protocol. Configuration takes its receiver settings from UBX::Plan and holds the control flow that depends on replies: baud detection and the UART handoff, jamming-detection fallback, time mode, survey-in and RTCM activation. Decoding turns UBX frames and forwarded RTCM3 frames into events without I/O: it records acknowledgements and readbacks for configuration, and requests the streaming commands that decoded traffic calls for.

Definition at line 50 of file UBXProtocol.h.

Member Function Documentation

◆ armDecodeOnly()

bool UBX::Protocol::armDecodeOnly ( const GPSConfig &  config,
GPSDecodeContext &  context 
)
overridevirtual

The decoder state a successful configure() leaves: navigation, survey and corrections decoding.

Reimplemented from GPSFamilyProtocol.

Definition at line 130 of file UBXDecoder.cc.

References config, and GPSDecodeContext::stream().

◆ armNavigationDecode()

bool UBX::Protocol::armNavigationDecode ( GPSNavigationDecode  decode,
GPSDecodeContext &  context 
)
overridevirtual

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 from GPSFamilyProtocol.

Definition at line 138 of file UBXDecoder.cc.

References GPSDecodeContext::stream().

◆ completeReceiveCycle()

bool UBX::Protocol::completeReceiveCycle ( GPSReceiveUpdates  handled)
overridevirtual

Whether a receive cycle has what it waits for: a pending readback, or else a navigation update.

Reimplemented from GPSFamilyProtocol.

Definition at line 151 of file UBXDecoder.cc.

References Position, UBX::ReceiverController::readbackPending(), and UBX::ReceiverController::readbackReady().

◆ configure()

bool UBX::Protocol::configure ( GPSCommandChannel &  channel,
GPSConfig  config,
unsigned &  baud 
)
overridevirtual

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.

Implements GPSFamilyProtocol.

Definition at line 40 of file UBXConfigurator.cc.

References Ashtech::Plan::BAUD_RATES, config, GPSCommandChannel::detectBaud(), GPSCommandChannel::failControl(), GPSCommandChannel::failed(), GPSCommandChannel::failNoAnswer(), Found, GPSCommandChannel::receiveCycle(), GPSStreamDemux::reset(), Stop, GPSCommandChannel::stream(), TryNext, UBX, and UBX::unknown.

◆ flush()

void UBX::Protocol::flush ( GPSDecodeContext &  context)
overridevirtual

Publishes epochs past their deadline.

Reimplemented from GPSFamilyProtocol.

Definition at line 123 of file UBXDecoder.cc.

References UBX::EpochAssembler::expire().

◆ identity()

QString UBX::Protocol::identity ( ) const
inlineoverridevirtual

Model and firmware reported during configuration; empty when unknown.

Reimplemented from GPSFamilyProtocol.

Definition at line 74 of file UBXProtocol.h.

References UBX::Identity::firmware, gpsReceiverIdentity(), and UBX::Identity::model.

◆ nextReadSlice()

std::chrono::milliseconds UBX::Protocol::nextReadSlice ( std::chrono::milliseconds  timeout) const
overridevirtual

Reads briefly once part of an epoch has arrived, as the rest follows back to back.

Reimplemented from GPSFamilyProtocol.

Definition at line 162 of file UBXDecoder.cc.

◆ onFrame()

GPSReceiveUpdates UBX::Protocol::onFrame ( const GPSFrame &  frame,
GPSDecodeContext &  context 
)
overridevirtual

Decodes one frame, publishing events to the context.

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

Implements GPSFamilyProtocol.

Definition at line 114 of file UBXDecoder.cc.

References GPSDecodeContext::publishRTCM(), and RTCM3.

◆ probe()

bool UBX::Protocol::probe ( GPSCommandChannel &  channel)
overridevirtual

The MON-VER poll Protocol::configure() identifies receivers with, under the same label and timeout.

Reimplemented from GPSFamilyProtocol.

Definition at line 692 of file UBXConfigurator.cc.

References Acknowledged, UBX::messageName(), UBX::Msg::MON_VER, Pending, GPSConfigurationEvidence::succeeded(), GPSCommandChannel::transact(), UBX, and UBX::MessageId::value().

◆ receiverReady()

bool UBX::Protocol::receiverReady ( ) const
inlineoverridevirtual

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 from GPSFamilyProtocol.

Definition at line 72 of file UBXProtocol.h.

◆ serviceStreaming()

void UBX::Protocol::serviceStreaming ( GPSCommandChannel &  channel)
overridevirtual

RTCM activation after survey-in and disabling unexpected output, as decoding requested.

Reimplemented from GPSFamilyProtocol.

Definition at line 409 of file UBXConfigurator.cc.

References GPSCommandChannel::failControl().

Member Data Documentation

◆ NAVIGATION_MESSAGES

constexpr std::array UBX::Protocol::NAVIGATION_MESSAGES
staticconstexpr
Initial value:
constexpr MessageId MON_HW
Definition UBXFrame.h:69
constexpr MessageId MON_RF
Definition UBXFrame.h:70
constexpr MessageId SEC_SIG
Definition UBXFrame.h:71
constexpr MessageId NAV_STATUS
Definition UBXFrame.h:44
constexpr MessageId NAV_DOP
Definition UBXFrame.h:45
constexpr MessageId NAV_SAT
Definition UBXFrame.h:50
constexpr MessageId NAV_SVINFO
Definition UBXFrame.h:49
constexpr MessageId NAV_HPPOSLLH
Definition UBXFrame.h:47
constexpr MessageId NAV_PVT
Definition UBXFrame.h:46

Output decoded in navigation mode, besides NAV-EOE and NAV-SVIN. Other output is dropped and the streaming services ask the receiver to stop it (any message on legacy receivers, Plan::UNEXPECTED_OUTPUT from protocol 27), so every message the configuration plan enables must be listed.

Definition at line 56 of file UBXProtocol.h.

◆ REPEATED_WARNING_INTERVAL

constexpr std::chrono::seconds UBX::Protocol::REPEATED_WARNING_INTERVAL {60}
staticconstexpr

A receiver warning or error repeated within this interval is logged at debug level.

Definition at line 61 of file UBXProtocol.h.


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