summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-02-06 17:55:11 -0800
committerGary E. Miller <gem@rellim.com>2019-02-06 17:55:11 -0800
commite160d4919eecdb14beae62f00055b2d10607399e (patch)
treeed7f5653832b8113b86fae74403eb0b020bb0462 /gpsd_json.c
parent1736a5b861203e85f4006104417d95017be4a4d9 (diff)
downloadgpsd-e160d4919eecdb14beae62f00055b2d10607399e.tar.gz
gpsd_json: Put new status values in TPV.
Nothing usesd it, yet.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 5c5fa5e1..41f42cc9 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -150,8 +150,10 @@ void json_tpv_dump(const struct gps_device_t *session,
(void)strlcpy(reply, "{\"class\":\"TPV\",", replylen);
if (gpsdata->dev.path[0] != '\0')
str_appendf(reply, replylen, "\"device\":\"%s\",", gpsdata->dev.path);
- if (gpsdata->status == STATUS_DGPS_FIX)
- str_appendf(reply, replylen, "\"status\":2,");
+ if (STATUS_DGPS_FIX <= gpsdata->status) {
+ /* to save rebuilding all the regressions, skip NO_FIX and FIX */
+ str_appendf(reply, replylen, "\"status\":%d,", gpsdata->status);
+ }
str_appendf(reply, replylen, "\"mode\":%d,", gpsdata->fix.mode);
if (isfinite(gpsdata->fix.time) != 0) {
char tbuf[JSON_DATE_MAX+1];