pud: only check gpsd status; no clear of info on bad fix or invalid signal
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 29 May 2017 09:41:26 +0000 (11:41 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 29 May 2017 09:43:15 +0000 (11:43 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/gpsdclient.c

index 8404945..0019d98 100644 (file)
@@ -355,6 +355,7 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
   gpsdata->set &= ~STATUS_SET; /* always valid */
   if (gpsdata->status == STATUS_NO_FIX) {
     nmeaInfoClear(info);
+    nmeaTimeSet(&info->utc, &info->present, NULL);
     return;
   }
 
@@ -411,13 +412,6 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
   nmeaInfoSetPresent(&info->present, NMEALIB_PRESENT_FIX | NMEALIB_PRESENT_SIG);
   gpsdata->set &= ~MODE_SET;
 
-  if ((info->fix == NMEALIB_FIX_BAD) //
-      || (info->sig == NMEALIB_SIG_INVALID)) {
-    nmeaInfoClear(info);
-    nmeaTimeSet(&info->utc, &info->present, NULL);
-    return;
-  }
-
   /* hdop */
   if (!isNaN(gpsdata->fix.epx) //
       && !isNaN(gpsdata->fix.epy)) {