summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-03-25 17:52:42 -0700
committerGary E. Miller <gem@rellim.com>2019-03-25 17:52:42 -0700
commit1b72497a7f44658b8a3e9b27f1c5d1f5bb7a615a (patch)
tree784c53f5f95c6efb01ea9cd496473b96fce03076 /gpsd_json.c
parentee37b0ec95ddda2d744687246c7cf6337211aecd (diff)
downloadgpsd-1b72497a7f44658b8a3e9b27f1c5d1f5bb7a615a.tar.gz
gps_data_t: Add datum field. Add decode for $PGRMM.
Sadly, $PGRMM is after a cycle ender and the data is never reported, so no regression changes. Cycle ender needs to get fixed...
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index a50bed0f..73aed7c7 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -267,10 +267,13 @@ void json_tpv_dump(const struct gps_device_t *session,
}
#endif /* TIMING_ENABLE */
/* at the end because it is new and microjson chokes on new items */
- if (isfinite(gpsdata->fix.eph) != 0)
+ if (0 != isfinite(gpsdata->fix.eph))
str_appendf(reply, replylen, "\"eph\":%.3f,", gpsdata->fix.eph);
- if (isfinite(gpsdata->fix.sep) != 0)
+ if (0 != isfinite(gpsdata->fix.sep))
str_appendf(reply, replylen, "\"sep\":%.3f,", gpsdata->fix.sep);
+ if ('\0' != gpsdata->fix.datum[0])
+ str_appendf(reply, replylen, "\"datum\":\"%.40s\",",
+ gpsdata->fix.datum);
}
str_rstrip_char(reply, ',');
(void)strlcat(reply, "}\r\n", replylen);