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

Functions

quint8 computeChecksum (const QByteArray &body)
 Compute XOR checksum over NMEA body (between '$' and '*').
 
bool verifyChecksum (const QByteArray &sentence)
 
QByteArray repairChecksum (const QByteArray &sentence)
 Repair or append a valid NMEA checksum and ensure CRLF termination.
 
QByteArray makeGGA (const QGeoCoordinate &coord, double altitudeMsl, int fixQuality=1, int numSatellites=12)
 Build a GGA sentence from a coordinate and altitude.
 

Function Documentation

◆ computeChecksum()

quint8 NMEAUtils::computeChecksum ( const QByteArray &  body)

Compute XOR checksum over NMEA body (between '$' and '*').

Definition at line 7 of file NMEAUtils.cc.

Referenced by makeGGA(), repairChecksum(), and verifyChecksum().

◆ makeGGA()

QByteArray NMEAUtils::makeGGA ( const QGeoCoordinate &  coord,
double  altitudeMsl,
int  fixQuality,
int  numSatellites 
)

Build a GGA sentence from a coordinate and altitude.

Definition at line 68 of file NMEAUtils.cc.

References computeChecksum().

◆ repairChecksum()

QByteArray NMEAUtils::repairChecksum ( const QByteArray &  sentence)

Repair or append a valid NMEA checksum and ensure CRLF termination.

Definition at line 31 of file NMEAUtils.cc.

References computeChecksum().

Referenced by NTRIPHttpTransport::sendNMEA().

◆ verifyChecksum()

bool NMEAUtils::verifyChecksum ( const QByteArray &  sentence)

Validate an NMEA sentence's checksum. Accepts sentences of the form $BODY*XX (with or without CRLF suffix). Returns false if the sentence is malformed or the checksum does not match.

Definition at line 16 of file NMEAUtils.cc.

References computeChecksum().