78#ifndef __FPSDK_COMMON_PARSER_NMEA_HPP__
79#define __FPSDK_COMMON_PARSER_NMEA_HPP__
140bool NmeaGetMessageName(
char* name,
const std::size_t size,
const uint8_t* msg,
const std::size_t msg_size);
156bool NmeaGetMessageInfo(
char* info,
const std::size_t size,
const uint8_t* msg,
const std::size_t msg_size);
490 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
514 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
541 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
566 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
594 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
615 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
639 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
667 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
696 bool SetFromMsg(
const uint8_t* msg,
const std::size_t msg_size);
771 bool AddGsaAndGsv(
const std::vector<NmeaGsaPayload>& gsas,
const std::vector<NmeaGsvPayload>& gsvs);
774 std::vector<NmeaSat> gsa_sats_;
NmeaSystemId
NMEA system IDs.
@ UNSPECIFIED
Unspecified.
NmeaModeRmcGns
NMEA-Gx-RMC and NMEA-Gx-GNS pos mode.
@ UNSPECIFIED
Unspecified.
static constexpr std::size_t NMEA_FRAME_SIZE
NMEA frame size ("$*cc\r\n")
NmeaOpModeGsa
NMEA-Gx-GNS operation mode.
@ UNSPECIFIED
Unspecified.
NmeaNavStatusRmc
NMEA-Gx-RMC navigational status.
@ UNSPECIFIED
Unspecified.
@ NA
Equipment does not provide navigational status.
static constexpr uint8_t NMEA_PREAMBLE
NMEA framing preamble.
NmeaModeGllVtg
NMEA-Gx-GLL and NMEA-Gx-VTG pos mode.
@ UNSPECIFIED
Unspecified.
@ AUTONOMOUS
Autonomous mode (SPP)
NmeaNavModeGsa
NMEA-Gx-GNS nav mode.
@ UNSPECIFIED
Unspecified.
NmeaTalkerId
NMEA talker IDs.
@ UNSPECIFIED
Unspecified.
@ PROPRIETARY
Proprietary.
@ GPS_SBAS
GPS and/or SBAS.
@ GNSS
GNSS (multi-constellation)
NmeaStatusGllRmc
NMEA-Gx-GLL and NMEA-Gx-RMC status.
@ UNSPECIFIED
Unspecified.
bool NmeaGetMessageInfo(char *info, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
Get NMEA message info.
bool NmeaGetMessageMeta(NmeaMessageMeta &meta, const uint8_t *msg, const std::size_t msg_size)
Get NMEA message meta data.
NmeaSignalId
NMEA signal IDs.
@ UNSPECIFIED
Unspecified.
@ GPS_L1CA
GPS L1 C/A or SBAS L1 C/A.
bool NmeaGetMessageName(char *name, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
Get NMEA message name.
NmeaQualityGga
NMEA-Gx-GGA quality indicator.
@ UNSPECIFIED
Unspecified.
@ DGNSS
Differential GPS fix (e.g. with SBAS)
@ SPP
Autonomous GNSS fix.
@ MANUAL
Manual input mode.
@ ESTIMATED
Estimated (dead reckoning only)
NmeaSystemId system
System ID.
int az
Azimuth [deg] (0..360)
int el
Elevation [deg] (-90..90)
int svid
Satellite ID (numbering cf. NMEA 0183)
int cno
Signal level [dBHz].
NmeaSignalId signal
Signal ID.
int svid
Satellite ID (numbering cf. NMEA 0183)
NmeaSystemId system
System ID.
int svid_
Satellite ID (numbering cf. NMEA 0183)
int az_
Azimuth [deg] (0..360)
NmeaSystemId system_
System ID.
int el_
Elevation [deg] (-90..90)
double cno_
Signal level [dBHz].
NmeaSystemId system_
System ID.
int svid_
Satellite ID (numbering cf. NMEA 0183)
NmeaSignalId signal_
Signal ID.
bool used_
Signal is used in navigation.
Collector for NMEA-Gx-GSA and NMEA-Gx-GPA.
bool AddGsa(const NmeaGsaPayload &gsa)
Add NMEA-GN-GSA message to collection.
std::vector< Sat > sats_
Collected satellite info.
bool AddGsv(const NmeaGsvPayload &gsv)
Add NMEA-Gx-GSV message to collection.
std::vector< Sig > sigs_
Collected signal info.
bool AddGsaAndGsv(const std::vector< NmeaGsaPayload > &gsas, const std::vector< NmeaGsvPayload > &gsvs)
Add NMEA-GN-GSA and NMEA-Gx-GSV messages to collection.
void Complete()
Complete collection after feeding all GSA and GSV messages.
NMEA coordinates (integer degrees, float minutes and a sign for N/S resp. E/W)
double min_
Fractional minutes value, >= 0.0.
NmeaCoordinates(const double degs, const int digits=5)
Constructor.
bool sign_
false for negative (S or W), true for positive (N or E)
int deg_
Integer degrees value, >= 0.
NMEA date (year, month, day)
bool operator==(const NmeaDate &rhs) const
Equal.
bool operator!=(const NmeaDate &rhs) const
Not equal.
NMEA-Gx-GGA message payload.
static constexpr const char * FORMATTER
Formatter.
NmeaFloat diff_age
Differential data age (optional, NMEA 4.11 only)
NmeaLlh llh
Position (with height)
NmeaFloat hdop
Horizontal dilution of precision (only with valid fix)
NmeaQualityGga quality
Fix quality.
NmeaInt diff_sta
Differential station ID (optional, NMEA 4.11 only)
NmeaInt num_sv
Number of satellites used (may be limited to 12)
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
NMEA-Gx-GLL message payload.
NmeaLlh ll
Position (no height)
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
static constexpr const char * FORMATTER
Formatter.
NmeaStatusGllRmc status
Positioning system status.
NmeaModeGllVtg mode
Positioning system mode.
NMEA-Gx-GSA message payload (NMEA 4.11 only!)
NmeaNavModeGsa navmode
Nav mode.
static constexpr const char * FORMATTER
Formatter.
NmeaOpModeGsa opmode
Operation mode.
int num_sats
Number of valid sats (the first n of sats[])
NmeaSystemId system
System ID.
std::array< NmeaSat, 12 > sats
Satellites, valid ones are 0..(num_sats-1)
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
NMEA-Gx-GST message payload.
NmeaFloat angle_major
Angle of semi-major axis of error ellipse from true North.
NmeaFloat std_lat
Standard deviation of latitude error.
NmeaFloat std_alt
Standard deviation of altitude error.
static constexpr const char * FORMATTER
Formatter.
NmeaFloat std_lon
Standard deviation of longitude error.
NmeaFloat std_major
Standard deviation of semi-major axis of error ellipse.
NmeaFloat rms_range
RMS value of the standard deviation of the range inputs to the navigation process.
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
NmeaFloat std_minor
Standard deviation of semi-minor axis of error ellipse.
NMEA-Gx-GSV message payload (NMEA 4.11 only!)
int num_azels
Number of valid satellite positions (the first n of azels[])
NmeaInt tot_num_sat
Number of sat/sig info in the whole sequence of GSV messages.
NmeaSystemId system
System ID.
NmeaInt num_msgs
Number of messages in this GSV sequence (for this signal ID)
NmeaInt msg_num
Message number in sequence (1...num_msgs)
std::array< NmeaAzEl, 4 > azels
Satellite positions, valid ones are 0..(num_sats-1)
NmeaSignalId signal
Signal ID.
std::array< NmeaCno, 4 > cnos
Signal levels, valid ones are 0..(num_sats-1)
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
int num_cnos
Number of valid signal levels (the first n of azels[])
static constexpr const char * FORMATTER
Formatter.
NMEA-Gx-HDT message payload.
NmeaFloat heading
True heading.
static constexpr const char * FORMATTER
Formatter.
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
double height
Ellipsoidal (!) height [m].
bool latlon_valid
Latitude/longitude is valid.
double lon
Longitude [deg], >= 0.0 North, < 0.0 South.
double lat
Latitude [deg], >= 0.0 East, < 0.0 West.
bool height_valid
Height is valid.
bool valid_
Payload successfully decoded (true), or not (yet) decoded (false)
virtual ~NmeaPayload()=default
Virtual dtor for polymorphism.
NmeaTalkerId talker
Talker.
NMEA-Gx-RMC message payload.
NmeaStatusGllRmc status
Positioning system status.
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
NmeaNavStatusRmc navstatus
Navigational status (optional)
static constexpr const char * FORMATTER
Formatter.
NmeaModeRmcGns mode
Positioning system mode indicator.
NmeaFloat speed
Speed over ground [knots].
NmeaFloat course
Course over ground w.r.t. True North [deg].
NMEA satellite (used, e.g. in GSA)
int svid
Satellite ID (numbering cf. NMEA 0183)
NmeaSystemId system
System ID.
NMEA time (hour, minutes, seconds)
bool operator==(const NmeaTime &rhs) const
Equal.
bool operator!=(const NmeaTime &rhs) const
Not equal.
Constants for different versions of NMEA.
const int svid_max_glo
Max GLONASS satellite ID.
const int svid_max_gps
Max GPS satellite ID.
const int svid_min_sbas
Min SBAS satellite ID.
const int svid_min_bds
Min BeiDou satellite ID.
static const NmeaVersion V410
Value for NMEA v4.10.
const int svid_max_qzss
Max QZSS satellite ID, -1 if not available.
const int svid_min_qzss
Min QZSS satellite ID, -1 if not available.
const int svid_min_gps
Min GPS satellite ID.
const int svid_min_gal
Min Galileo satellite ID.
const int svid_max_gal
Max Galileo satellite ID.
const int svid_max_sbas
Max SBAS satellite ID.
static const NmeaVersion V410_UBX_EXT
Value for NMEA v4.10 extended (u-blox flavour)
const int svid_min_glo
Min GLONASS satellite ID.
static const NmeaVersion V411
Value for NMEA v4.11.
const int svid_max_bds
Max BeiDou satellite ID.
NMEA-Gx-VTG message payload.
NmeaFloat cogt
Course over ground (true) [deg].
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
NmeaModeGllVtg mode
Positioning system mode.
NmeaFloat sogk
Speed over ground [km/h].
static constexpr const char * FORMATTER
Talker.
NmeaFloat sogn
Speed over ground [knots].
NmeaFloat cogm
Course over ground (magnetic) [deg], not typically available.
NMEA-Gx-ZDA message payload.
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)
Set data from sentence.
NmeaInt local_hr
Local zone hours, always 00 (= UTC)
static constexpr const char * FORMATTER
Formatter.
NmeaInt local_min
Local zone minutes, always 00 (= UTC)