QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSNMEAStream Class Reference

#include <GPSNMEAStream.h>

+ Collaboration diagram for GPSNMEAStream:

Public Types

enum class  Navigation { StandardNMEA , ReceiverSpecific }
 Who turns sentences into positions: this stream from standard NMEA, or the family's own sentences. More...
 

Public Member Functions

 GPSNMEAStream (Navigation navigation=Navigation::StandardNMEA)
 
void reset (GPSStreamDemux &stream)
 Starts a new receiver session: clears every framer of stream, the epochs and the working reports.
 
void setRTCMEnabled (bool enabled)
 
template<typename Vendor >
GPSReceiveUpdates onFrame (const GPSFrame &frame, GPSDecodeContext &context, Vendor &&vendor)
 
GPSReceiveUpdates onFrame (const GPSFrame &frame, GPSDecodeContext &context)
 The whole frame handling for a family without vendor sentences.
 
void flush (GPSDecodeContext &context)
 Expires untimed metadata and publishes satellite epochs that became due.
 
std::chrono::milliseconds limitReceiveTimeout (std::chrono::milliseconds timeout, uint64_t nowUs) const
 Shortens a receive timeout so a pending satellite epoch is published when it becomes due.
 
GPSReceiveUpdates receive (GPSCommandChannel &channel, std::chrono::milliseconds timeout) const
 
GPSDecodedPosition & position ()
 

Static Public Attributes

static constexpr GPSStreamConfig STREAM
 Framers an ASCII family's descriptor declares.
 

Detailed Description

Standard NMEA navigation and satellite epochs plus RTCM3 pass-through, composed by the ASCII receiver families. Binary RTCM payloads never enter the line parser. A family hands each frame, a line or a checked sentence, to onFrame() with its vendor handling, which shares the working position through position().

Definition at line 18 of file GPSNMEAStream.h.

Member Enumeration Documentation

◆ Navigation

enum class GPSNMEAStream::Navigation
strong

Who turns sentences into positions: this stream from standard NMEA, or the family's own sentences.

Enumerator
StandardNMEA 
ReceiverSpecific 

Definition at line 22 of file GPSNMEAStream.h.

Constructor & Destructor Documentation

◆ GPSNMEAStream()

GPSNMEAStream::GPSNMEAStream ( Navigation  navigation = Navigation::StandardNMEA)
explicit

Definition at line 54 of file GPSNMEAStream.cc.

Member Function Documentation

◆ flush()

void GPSNMEAStream::flush ( GPSDecodeContext &  context)

Expires untimed metadata and publishes satellite epochs that became due.

Definition at line 123 of file GPSNMEAStream.cc.

References NMEA::NavigationEpochAssembler::expireUntimedMetadata(), NMEA::SatelliteAssembler::flushDue(), and GPSDecodeContext::nowUs().

Referenced by GPSNMEAFamilyProtocol::flush().

◆ limitReceiveTimeout()

std::chrono::milliseconds GPSNMEAStream::limitReceiveTimeout ( std::chrono::milliseconds  timeout,
uint64_t  nowUs 
) const

Shortens a receive timeout so a pending satellite epoch is published when it becomes due.

Definition at line 133 of file GPSNMEAStream.cc.

References NMEA::SatelliteAssembler::deadlineUs(), and GPSDeadline::remaining().

Referenced by receive().

◆ onFrame() [1/2]

GPSReceiveUpdates GPSNMEAStream::onFrame ( const GPSFrame &  frame,
GPSDecodeContext &  context 
)
inline

The whole frame handling for a family without vendor sentences.

Definition at line 56 of file GPSNMEAStream.h.

References onFrame().

◆ onFrame() [2/2]

template<typename Vendor >
GPSReceiveUpdates GPSNMEAStream::onFrame ( const GPSFrame &  frame,
GPSDecodeContext &  context,
Vendor &&  vendor 
)
inline

The whole frame handling: publishes an RTCM3 frame, or decodes a line or sentence as standard NMEA, then with vendor, which takes the line and returns its updates, and publishes what the line completed.

Definition at line 42 of file GPSNMEAStream.h.

References ASCIILine, NMEASentence, and RTCM3.

Referenced by onFrame(), and GPSNMEAFamilyProtocol::onFrame().

◆ position()

GPSDecodedPosition & GPSNMEAStream::position ( )
inline

Definition at line 72 of file GPSNMEAStream.h.

◆ receive()

GPSReceiveUpdates GPSNMEAStream::receive ( GPSCommandChannel &  channel,
std::chrono::milliseconds  timeout 
) const

An ASCII family's streaming receive: a receive cycle bounded by limitReceiveTimeout(), then the streaming services.

Definition at line 141 of file GPSNMEAStream.cc.

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

Referenced by GPSNMEAFamilyProtocol::receive().

◆ reset()

void GPSNMEAStream::reset ( GPSStreamDemux &  stream)

Starts a new receiver session: clears every framer of stream, the epochs and the working reports.

Definition at line 58 of file GPSNMEAStream.cc.

References NMEA::SatelliteAssembler::clear(), NMEA::NavigationEpochAssembler::reset(), and GPSStreamDemux::reset().

◆ setRTCMEnabled()

void GPSNMEAStream::setRTCMEnabled ( bool  enabled)
inline

Definition at line 37 of file GPSNMEAStream.h.

Referenced by GPSNMEAFamilyProtocol::GPSNMEAFamilyProtocol().

Member Data Documentation

◆ STREAM

constexpr GPSStreamConfig GPSNMEAStream::STREAM
staticconstexpr
Initial value:
@ ASCIILine
Printable lines up to CR/LF, without the terminator; the decoder checks checksums.
@ RTCM3
0xD3 frames with a valid CRC-24Q.

Framers an ASCII family's descriptor declares.

Definition at line 29 of file GPSNMEAStream.h.


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