QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NMEA Namespace Reference

Namespaces

namespace  SatelliteIds
namespace  Field
namespace  GgaQuality
namespace  FixDimension

Classes

class  Framer
class  LineFramer
 Frames printable ASCII lines. A '$' or '#' restarts the line, so a sentence or log is not lost after garbage. More...
struct  NavigationEpoch
struct  NavigationUpdate
class  NavigationEpochAssembler
struct  SatelliteData
struct  SatelliteSystem
struct  GSV
class  SatelliteAssembler
 Bounded multipart/multisignal assembly; scheduling and delivery remain with the caller. More...
struct  Sentence
struct  Frame
 Views into a single wire frame; the caller owns the backing bytes. More...
struct  GGA
struct  UtcDate
struct  RMC
struct  GLL
struct  VTG
struct  ZDA
struct  NavigationStatus
struct  GST

Typedefs

using SatelliteEpoch = std::vector<SatelliteSystem>

Functions

GPSConstellation satelliteConstellation (std::string_view talker, std::optional< int > systemId, std::optional< int > satelliteId)
std::optional< GSV > gsv (const Sentence &input)
int satelliteId (GPSConstellation constellation, int wireId)
 Canonical constellation-local identifier; preserve unknown/vendor ranges unchanged.
unsigned char checksum (std::string_view body)
std::optional< uint32_t > hexNumber (std::string_view digits)
 The value of digits when every one is a hexadecimal digit, with no sign or prefix; nullopt otherwise.
size_t splitFields (std::string_view text, std::span< std::string_view > fields)
 Preserve empty fields, including the final field. Return zero on storage overflow.
std::optional< Frame > frame (std::string_view text)
bool isStandardSentence (std::string_view text)
 A checked sentence from a standard talker, not a proprietary $P... sentence.
std::optional< Sentence > sentence (std::string_view text)
double degreesFromDegreesMinutes (double ddmm)
 Convert a signed ddmm.mmmm (or dddmm.mmmm) value; invalid values return NaN.
std::optional< double > coordinate (std::string_view field, std::string_view hemisphere, bool latitude)
std::optional< GGA > gga (const Sentence &input)
 Quality zero is a valid fix-loss observation with empty coordinates and optional hemisphere fields.
std::optional< int > utcMilliseconds (std::string_view field)
std::optional< UtcDate > rmcDate (std::string_view field)
std::optional< RMC > rmc (const Sentence &input)
std::optional< GLL > gll (const Sentence &input)
std::optional< VTG > vtg (const Sentence &input)
std::optional< ZDA > zda (const Sentence &input)
GPSFixQuality fixQuality (unsigned quality, GPSFixQuality autonomous)
 Autonomous GGA does not distinguish 2D/3D; the caller supplies its independently resolved quality.
std::optional< NavigationStatus > navigationStatus (const Sentence &input)
std::optional< GST > gst (const Sentence &input)
template<class T>
std::optional< T > number (std::string_view field, int base=DECIMAL_BASE)
constexpr bool isAsciiDigit (char ch)
 Locale-independent ASCII character classes for receiver text.
constexpr bool isAsciiUpper (char ch)

Variables

constexpr int DECIMAL_BASE = 10
constexpr int HEX_BASE = 16
constexpr int CHECKSUM_DIGITS = 2
constexpr double MINUTES_PER_DEGREE = 60.0

Typedef Documentation

◆ SatelliteEpoch

using NMEA::SatelliteEpoch = std::vector<SatelliteSystem>

Definition at line 85 of file NMEASatellites.h.

Function Documentation

◆ checksum()

unsigned char NMEA::checksum ( std::string_view body)
nodiscard

Definition at line 55 of file NMEASentence.cc.

References QGC::nmeaChecksum().

Referenced by NMEAUtils::frame(), and NMEA::Frame::hasValidChecksum().

◆ coordinate()

std::optional< double > NMEA::coordinate ( std::string_view field,
std::string_view hemisphere,
bool latitude )
nodiscard

Definition at line 147 of file NMEASentence.cc.

References MINUTES_PER_DEGREE, and number().

Referenced by gga(), gll(), and rmc().

◆ degreesFromDegreesMinutes()

double NMEA::degreesFromDegreesMinutes ( double ddmm)
nodiscard

Convert a signed ddmm.mmmm (or dddmm.mmmm) value; invalid values return NaN.

Definition at line 137 of file NMEASentence.cc.

References MINUTES_PER_DEGREE.

◆ fixQuality()

GPSFixQuality NMEA::fixQuality ( unsigned quality,
GPSFixQuality autonomous )
nodiscard

Autonomous GGA does not distinguish 2D/3D; the caller supplies its independently resolved quality.

Definition at line 321 of file NMEASentence.cc.

References NMEA::GgaQuality::DIFFERENTIAL, NMEA::GgaQuality::ESTIMATED, NMEA::GgaQuality::GPS, NMEA::GgaQuality::INVALID, NMEA::GgaQuality::MANUAL, NMEA::GgaQuality::RTK_FIXED, and NMEA::GgaQuality::RTK_FLOAT.

◆ frame()

std::optional< Frame > NMEA::frame ( std::string_view text)
nodiscard

Split a printable $BODY[*CHECKSUM] frame, accepting no terminator, LF, or CRLF. Checksum syntax and value are checked separately so malformed checksums can be repaired.

Definition at line 91 of file NMEASentence.cc.

References NMEA::Sentence::PREFIX_LENGTH.

Referenced by QuectelCodec::checkedBody(), NMEAUtils::repairChecksum(), and sentence().

◆ gga()

◆ gll()

◆ gst()

◆ gsv()

◆ hexNumber()

std::optional< uint32_t > NMEA::hexNumber ( std::string_view digits)
nodiscard

The value of digits when every one is a hexadecimal digit, with no sign or prefix; nullopt otherwise.

Definition at line 60 of file NMEASentence.cc.

References HEX_BASE.

Referenced by gpsASCIILog(), and NMEA::Frame::hasValidChecksum().

◆ isAsciiDigit()

bool NMEA::isAsciiDigit ( char ch)
nodiscardconstexpr

Locale-independent ASCII character classes for receiver text.

Definition at line 157 of file NMEASentence.h.

◆ isAsciiUpper()

bool NMEA::isAsciiUpper ( char ch)
nodiscardconstexpr

Definition at line 162 of file NMEASentence.h.

◆ isStandardSentence()

bool NMEA::isStandardSentence ( std::string_view text)
nodiscard

A checked sentence from a standard talker, not a proprietary $P... sentence.

Definition at line 116 of file NMEASentence.cc.

References sentence().

◆ navigationStatus()

std::optional< NavigationStatus > NMEA::navigationStatus ( const Sentence & input)
nodiscard

Receiver-declared validity, independent of coordinate availability. A valid flag alone is not a usable fix. GSA is untimed; malformed/unsupported status fields return no observation.

Definition at line 343 of file NMEASentence.cc.

References NMEA::Sentence::count, NMEA::Sentence::fields, NMEA::Field::GGA_QUALITY, NMEA::Field::GLL_STATUS, NMEA::Field::GLL_TIME, NMEA::Field::GSA_DIMENSION, NMEA::GgaQuality::INVALID, NMEA::GgaQuality::MAX_VALUE, NMEA::FixDimension::NO_FIX, number(), NMEA::Field::RMC_STATUS, NMEA::FixDimension::THREE_D, NMEA::Sentence::type(), NMEA::Field::UTC_TIME, and utcMilliseconds().

Referenced by NMEA::NavigationEpochAssembler::ingest().

◆ number()

template<class T>
std::optional< T > NMEA::number ( std::string_view field,
int base = DECIMAL_BASE )
nodiscard

◆ rmc()

◆ rmcDate()

std::optional< UtcDate > NMEA::rmcDate ( std::string_view field)
nodiscard

Definition at line 236 of file NMEASentence.cc.

References number().

◆ satelliteConstellation()

GPSConstellation NMEA::satelliteConstellation ( std::string_view talker,
std::optional< int > systemId,
std::optional< int > satelliteId )
nodiscard

Definition at line 39 of file NMEASatellites.cc.

References satelliteId().

Referenced by gsv(), and NMEA::SatelliteAssembler::ingest().

◆ satelliteId()

int NMEA::satelliteId ( GPSConstellation constellation,
int wireId )
inlinenodiscard

Canonical constellation-local identifier; preserve unknown/vendor ranges unchanged.

Definition at line 32 of file NMEASatellites.h.

References BeiDou, Galileo, GLONASS, QZSS, and SBAS.

Referenced by gsv(), NMEA::SatelliteAssembler::ingest(), and satelliteConstellation().

◆ sentence()

std::optional< Sentence > NMEA::sentence ( std::string_view text)
nodiscard

◆ splitFields()

size_t NMEA::splitFields ( std::string_view text,
std::span< std::string_view > fields )

Preserve empty fields, including the final field. Return zero on storage overflow.

Definition at line 70 of file NMEASentence.cc.

Referenced by sentence().

◆ utcMilliseconds()

std::optional< int > NMEA::utcMilliseconds ( std::string_view field)

Definition at line 206 of file NMEASentence.cc.

References DECIMAL_BASE, and number().

Referenced by gll(), NMEA::SatelliteAssembler::ingest(), navigationStatus(), rmc(), and zda().

◆ vtg()

◆ zda()

Variable Documentation

◆ CHECKSUM_DIGITS

int NMEA::CHECKSUM_DIGITS = 2
constexpr

Definition at line 21 of file NMEASentence.h.

Referenced by NMEA::Frame::hasValidChecksum().

◆ DECIMAL_BASE

int NMEA::DECIMAL_BASE = 10
constexpr

Definition at line 19 of file NMEASentence.h.

Referenced by NMEAUtils::makeGGA(), number(), and utcMilliseconds().

◆ HEX_BASE

int NMEA::HEX_BASE = 16
constexpr

Definition at line 20 of file NMEASentence.h.

Referenced by gsv(), hexNumber(), and NMEA::SatelliteAssembler::ingest().

◆ MINUTES_PER_DEGREE

double NMEA::MINUTES_PER_DEGREE = 60.0
constexpr

Definition at line 22 of file NMEASentence.h.

Referenced by coordinate(), degreesFromDegreesMinutes(), and NMEAUtils::makeGGA().