diff options
author | Gary E. Miller <gem@rellim.com> | 2019-03-22 20:17:48 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-03-22 20:17:48 -0700 |
commit | 259196e2ece002ff63a0da1831a90e6c0b74ea7f (patch) | |
tree | 02380d00b2932c39138fe27d9ef1f7bf61db6aa4 /gpsd_json.c | |
parent | 3d1b7493c58f80a93b9bbec33717fd3055841ae1 (diff) | |
download | gpsd-259196e2ece002ff63a0da1831a90e6c0b74ea7f.tar.gz |
Split epe into eph and sep.
Try to do it with forward and backward compatibility, which is
challenging with current miscojson.
Sometimes epe was used to 2D estimated erro. Sometimes for 3D error.
So make it explicit eph is 2D, and sep is 3D.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index 92003c6e..a50bed0f 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -192,8 +192,6 @@ void json_tpv_dump(const struct gps_device_t *session, str_appendf(reply, replylen, "\"epx\":%.3f,", gpsdata->fix.epx); if (isfinite(gpsdata->fix.epy) != 0) str_appendf(reply, replylen, "\"epy\":%.3f,", gpsdata->fix.epy); - if (isfinite(gpsdata->fix.epe) != 0) - str_appendf(reply, replylen, "\"epe\":%.3f,", gpsdata->fix.epe); if (isfinite(gpsdata->fix.epv) != 0) str_appendf(reply, replylen, "\"epv\":%.3f,", gpsdata->fix.epv); if (isfinite(gpsdata->fix.track) != 0) @@ -268,6 +266,11 @@ void json_tpv_dump(const struct gps_device_t *session, session->context->rollovers); } #endif /* TIMING_ENABLE */ + /* at the end because it is new and microjson chokes on new items */ + if (isfinite(gpsdata->fix.eph) != 0) + str_appendf(reply, replylen, "\"eph\":%.3f,", gpsdata->fix.eph); + if (isfinite(gpsdata->fix.sep) != 0) + str_appendf(reply, replylen, "\"sep\":%.3f,", gpsdata->fix.sep); } str_rstrip_char(reply, ','); (void)strlcat(reply, "}\r\n", replylen); |