From 324d3c406010b1d288e622e7cf8fd48f31c3682a Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 23 Mar 2022 11:12:44 +0100 Subject: [PATCH] #38: handle status for RMC and quality for GGA --- lib/nmea0183ton2k/NMEA0183DataToN2K.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/nmea0183ton2k/NMEA0183DataToN2K.cpp b/lib/nmea0183ton2k/NMEA0183DataToN2K.cpp index e83731f0..bc0f4686 100644 --- a/lib/nmea0183ton2k/NMEA0183DataToN2K.cpp +++ b/lib/nmea0183ton2k/NMEA0183DataToN2K.cpp @@ -350,6 +350,10 @@ class NMEA0183DataToN2KFunctions : public NMEA0183DataToN2K LOG_DEBUG(GwLog::DEBUG, "failed to parse RMC %s", msg.line); return; } + if (status != 'A' && status != 'a'){ + LOG_DEBUG(GwLog::DEBUG, "invalid status %c for RMC %s",status, msg.line); + return; + } tN2kMsg n2kMsg; if ( UD(GPST) && @@ -750,6 +754,10 @@ class NMEA0183DataToN2KFunctions : public NMEA0183DataToN2K LOG_DEBUG(GwLog::DEBUG, "failed to parse GGA %s", msg.line); return; } + if (GPSQualityIndicator == 0){ + LOG_DEBUG(GwLog::DEBUG, "quality 0 (no fix) for GGA %s", msg.line); + return; + } if (! updateDouble(boatData->GPST,GPSTime,msg.sourceId)) return; if (! updateDouble(boatData->LAT,Latitude,msg.sourceId)) return; if (! updateDouble(boatData->LON,Longitude,msg.sourceId)) return;