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

#include <GPSNMEAFamilyProtocol.h>

+ Inheritance diagram for GPSNMEAFamilyProtocol:
+ Collaboration diagram for GPSNMEAFamilyProtocol:

Public Member Functions

GPSReceiveUpdates onFrame (const GPSFrame &frame, GPSDecodeContext &context) final
 
void flush (GPSDecodeContext &context) final
 Expires the family's stale state, then flushes the NMEA stream.
 
bool receiverReady () const final
 
GPSReceiveUpdates receive (GPSCommandChannel &channel, std::chrono::milliseconds timeout) final
 After a failure, flushes at once so the expiry it causes is published with it.
 
- Public Member Functions inherited from GPSFamilyProtocol
virtual ~GPSFamilyProtocol ()=default
 
virtual bool configure (GPSCommandChannel &channel, GPSConfig config, unsigned &baud)=0
 
virtual bool probe (GPSCommandChannel &channel)
 
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 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

 GPSNMEAFamilyProtocol (GPSNMEAStream::Navigation navigation=GPSNMEAStream::Navigation::StandardNMEA)
 
virtual GPSReceiveUpdates _decodeLine (std::string_view line, GPSDecodeContext &context)=0
 Decodes one line after standard NMEA did.
 
virtual void _expire (GPSDecodeContext &context)
 Drops state that is stale or that a recorded failure invalidated; runs before each decode.
 
- Protected Member Functions inherited from GPSFamilyProtocol
 GPSFamilyProtocol ()=default
 

Protected Attributes

GPSNMEAStream _nmea
 
bool _ready = false
 Whether the receiver runs as the latest configure() set it up.
 

Static Protected Attributes

static constexpr std::chrono::seconds STATUS_MAX_AGE {5}
 How long a periodic receiver report, such as base status or time metadata, stays current.
 
static constexpr std::chrono::milliseconds STATUS_POLL {1000}
 The longest read of a family that expires its status, so expiry runs on a silent link too.
 

Detailed Description

A family whose receivers speak NMEA-framed text with RTCM3: GPSNMEAStream decodes the standard sentences and corrections, and the family adds its own lines, its expiry and its configuration. RTCM3 is published only once the family enables it.

Definition at line 13 of file GPSNMEAFamilyProtocol.h.

Constructor & Destructor Documentation

◆ GPSNMEAFamilyProtocol()

GPSNMEAFamilyProtocol::GPSNMEAFamilyProtocol ( GPSNMEAStream::Navigation  navigation = GPSNMEAStream::Navigation::StandardNMEA)
inlineexplicitprotected

Definition at line 47 of file GPSNMEAFamilyProtocol.h.

References _nmea, and GPSNMEAStream::setRTCMEnabled().

Member Function Documentation

◆ _decodeLine()

virtual GPSReceiveUpdates GPSNMEAFamilyProtocol::_decodeLine ( std::string_view  line,
GPSDecodeContext &  context 
)
protectedpure virtual

Decodes one line after standard NMEA did.

Returns
its updates.

Referenced by onFrame().

◆ _expire()

virtual void GPSNMEAFamilyProtocol::_expire ( GPSDecodeContext &  context)
inlineprotectedvirtual

Drops state that is stale or that a recorded failure invalidated; runs before each decode.

Definition at line 57 of file GPSNMEAFamilyProtocol.h.

Referenced by flush().

◆ flush()

void GPSNMEAFamilyProtocol::flush ( GPSDecodeContext &  context)
inlinefinalvirtual

Expires the family's stale state, then flushes the NMEA stream.

Reimplemented from GPSFamilyProtocol.

Definition at line 23 of file GPSNMEAFamilyProtocol.h.

References _expire(), _nmea, and GPSNMEAStream::flush().

◆ onFrame()

GPSReceiveUpdates GPSNMEAFamilyProtocol::onFrame ( const GPSFrame &  frame,
GPSDecodeContext &  context 
)
inlinefinalvirtual

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 16 of file GPSNMEAFamilyProtocol.h.

References _decodeLine(), _nmea, and GPSNMEAStream::onFrame().

◆ receive()

GPSReceiveUpdates GPSNMEAFamilyProtocol::receive ( GPSCommandChannel &  channel,
std::chrono::milliseconds  timeout 
)
inlinefinalvirtual

After a failure, flushes at once so the expiry it causes is published with it.

Reimplemented from GPSFamilyProtocol.

Definition at line 32 of file GPSNMEAFamilyProtocol.h.

References _nmea, and GPSNMEAStream::receive().

◆ receiverReady()

bool GPSNMEAFamilyProtocol::receiverReady ( ) const
inlinefinalvirtual

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 29 of file GPSNMEAFamilyProtocol.h.

References _ready.

Member Data Documentation

◆ _nmea

GPSNMEAStream GPSNMEAFamilyProtocol::_nmea
protected

Definition at line 59 of file GPSNMEAFamilyProtocol.h.

Referenced by flush(), GPSNMEAFamilyProtocol(), onFrame(), and receive().

◆ _ready

bool GPSNMEAFamilyProtocol::_ready = false
protected

Whether the receiver runs as the latest configure() set it up.

Definition at line 61 of file GPSNMEAFamilyProtocol.h.

Referenced by receiverReady().

◆ STATUS_MAX_AGE

constexpr std::chrono::seconds GPSNMEAFamilyProtocol::STATUS_MAX_AGE {5}
staticconstexprprotected

How long a periodic receiver report, such as base status or time metadata, stays current.

Definition at line 43 of file GPSNMEAFamilyProtocol.h.

◆ STATUS_POLL

constexpr std::chrono::milliseconds GPSNMEAFamilyProtocol::STATUS_POLL {1000}
staticconstexprprotected

The longest read of a family that expires its status, so expiry runs on a silent link too.

Definition at line 45 of file GPSNMEAFamilyProtocol.h.


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