summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-16 12:12:44 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-16 12:12:44 -0500
commit4065570e5f2e1858d959a0b31f77443aca0d3da3 (patch)
tree30b2e31ca222eb00fd00f48212ddd5609ebb9c26
parent4066069c4fe9fe3b65acfd41f496cdcd842578dd (diff)
downloadgpsd-4065570e5f2e1858d959a0b31f77443aca0d3da3.tar.gz
Suppress spurious offline messages.
-rw-r--r--libgpsd_core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 57f904e6..58b010ec 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -997,10 +997,13 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
session->gpsdata.online = 0;
return ERROR_IS;
} else if (newlen == 0) { /* zero length read, possible EOF */
- gpsd_report(LOG_INF, "GPS on %s is offline (%lf sec since data)\n",
- session->gpsdata.dev.path,
- timestamp() - session->gpsdata.online);
- session->gpsdata.online = 0;
+
+ if (session->gpsdata.online > 0 && timestamp() - session->gpsdata.online >= session->gpsdata.dev.cycle * 2) {
+ gpsd_report(LOG_INF, "GPS on %s is offline (%lf sec since data)\n",
+ session->gpsdata.dev.path,
+ timestamp() - session->gpsdata.online);
+ session->gpsdata.online = 0;
+ }
return NODATA_IS;
} else if (session->packet.outbuflen == 0) { /* got new data, but no packet */
gpsd_report(LOG_RAW + 3, "New data on %s, not yet a packet\n",