diff options
author | Gary E. Miller <gem@rellim.com> | 2018-11-05 18:46:01 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-11-05 18:46:01 -0800 |
commit | e5fdf82ff4767d09d5b9472131c0426ac06c8674 (patch) | |
tree | f030397d915483f623564e0f4ad3c61a19873396 /gpsd_json.c | |
parent | 0efea9b5b4e0ef0de100532630e8d10f2ef5eaaf (diff) | |
download | gpsd-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.c | 4 |
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); /* |