diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-22 00:31:55 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-22 00:31:55 -0400 |
commit | 0611d22ad71f4b84b5cea0e5990d5aeaf66f4c47 (patch) | |
tree | b7adb6a5bcd8eee6a680af9449972684bdbd9ea5 /gpsd_json.c | |
parent | 9eb349a06a5d2739bc22271dbc776711a59ce06e (diff) | |
download | gpsd-0611d22ad71f4b84b5cea0e5990d5aeaf66f4c47.tar.gz |
Emit "mode" before its dependent attributes in TPV, and timestamps with .3f.
Required a regression-test rebuild.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index d30da9a8..7eb92e6b 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -126,6 +126,9 @@ void json_tpv_dump(const struct gps_data_t *gpsdata, (void)snprintf(reply + strlen(reply), replylen - strlen(reply), "\"device\":\"%s\",", gpsdata->dev.path); + (void)snprintf(reply + strlen(reply), + replylen - strlen(reply), + "\"mode\":%d,", gpsdata->fix.mode); if (isnan(gpsdata->fix.time) == 0) (void)snprintf(reply + strlen(reply), replylen - strlen(reply), @@ -195,9 +198,6 @@ void json_tpv_dump(const struct gps_data_t *gpsdata, replylen - strlen(reply), "\"epc\":%.2f,", gpsdata->fix.epc); } - (void)snprintf(reply + strlen(reply), - replylen - strlen(reply), - "\"mode\":%d,", gpsdata->fix.mode); if (reply[strlen(reply) - 1] == ',') reply[strlen(reply) - 1] = '\0'; /* trim trailing comma */ (void)strlcat(reply, "}\r\n", sizeof(reply) - strlen(reply)); |