diff options
author | Gary E. Miller <gem@rellim.com> | 2018-10-26 09:53:46 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-10-26 09:53:46 -0700 |
commit | c4c4b7d9a79a812a8fd30dcaa9d48744d4e1de7a (patch) | |
tree | 86836eeaecf38720b370514c5ae959a55081d6e6 /gpsd_json.c | |
parent | 91d7012a6fb26c326d326404dd324ebcef204db8 (diff) | |
download | gpsd-c4c4b7d9a79a812a8fd30dcaa9d48744d4e1de7a.tar.gz |
gpsd_json: Add more fields to RAW message.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index d999b3b3..62a38e25 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -718,7 +718,7 @@ void json_subframe_dump(const struct gps_data_t *datap, (void)strlcat(buf, "}\r\n", buflen); } -/* RAW dump */ +/* RAW dump - should be good enough to make a RINEX 3 file */ void json_raw_dump(const struct gps_data_t *gpsdata, char *reply, size_t replylen) { @@ -735,16 +735,13 @@ void json_raw_dump(const struct gps_data_t *gpsdata, if (0 == gpsdata->raw[i].mtime) { continue; } - (void)strlcat(reply, "{", replylen); - if (0 != isfinite(gpsdata->raw[i].codephase)) { - str_appendf(reply, replylen, "\"codephase\":\"%f\"", - gpsdata->raw[i].codephase); - comma = true; - } + str_appendf(reply, replylen, "{\"gnssid\":%d,\"svid\":%d,\"snr\":%d", + gpsdata->raw[i].gnssid, gpsdata->raw[i].svid, + gpsdata->raw[i].snr); + comma = true; + if (0 != isfinite(gpsdata->raw[i].carrierphase)) { - if (comma) - (void)strlcat(reply, ",", replylen); - str_appendf(reply, replylen, "\"carrierphase\":\"%f\"", + str_appendf(reply, replylen, ",\"carrierphase\":\"%f\"", gpsdata->raw[i].carrierphase); comma = true; } @@ -755,13 +752,6 @@ void json_raw_dump(const struct gps_data_t *gpsdata, gpsdata->raw[i].pseudorange); comma = true; } - if (0 != isfinite(gpsdata->raw[i].deltarange)) { - if (comma) - (void)strlcat(reply, ",", replylen); - str_appendf(reply, replylen, "\"deltarange\":\"%f\"", - gpsdata->raw[i].deltarange); - comma = true; - } if (0 != isfinite(gpsdata->raw[i].doppler)) { if (comma) (void)strlcat(reply, ",", replylen); |