summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-11-05 18:46:01 -0800
committerGary E. Miller <gem@rellim.com>2018-11-05 18:46:01 -0800
commite5fdf82ff4767d09d5b9472131c0426ac06c8674 (patch)
treef030397d915483f623564e0f4ad3c61a19873396 /gpsd_json.c
parent0efea9b5b4e0ef0de100532630e8d10f2ef5eaaf (diff)
downloadgpsd-e5fdf82ff4767d09d5b9472131c0426ac06c8674.tar.gz
TPV: Add leapseconds to TPV JSON.
Most current gpsd drivers do not report leap seconds.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 2f98e17f..d782957c 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -156,6 +156,10 @@ void json_tpv_dump(const struct gps_device_t *session,
"\"time\":\"%s\",",
unix_to_iso8601(gpsdata->fix.time, tbuf, sizeof(tbuf)));
}
+ if (LEAP_SECOND_VALID == (session->context->valid & LEAP_SECOND_VALID)) {
+ str_appendf(reply, replylen, "\"leapseconds\":%d,",
+ session->context->leap_seconds);
+ }
if (isfinite(gpsdata->fix.ept) != 0)
str_appendf(reply, replylen, "\"ept\":%.3f,", gpsdata->fix.ept);
/*