diff options
author | Gary E. Miller <gem@rellim.com> | 2019-05-17 17:33:06 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-05-17 17:33:06 -0700 |
commit | 844287c4db1b22ca4f19e343e3fbb6c25eb35df4 (patch) | |
tree | 3e506ea0eb283d3849f01c0b75f7439a0c67b96f /gpsd_json.c | |
parent | ceb9aecb9123e73b2b555bd131d083182fb3b8d1 (diff) | |
download | gpsd-844287c4db1b22ca4f19e343e3fbb6c25eb35df4.tar.gz |
gpsd_json: RAW, only output freqid for GLO, skip GLO PRN 255.
Only GLONASS uses freqid, no need for other GNSS. GLO PRN 255
is not tracked yet, useless in RAW.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index 91120b4c..b0173d62 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -768,20 +768,26 @@ void json_raw_dump(const struct gps_data_t *gpsdata, for (i = 0; i < MAXCHANNELS; i++) { bool comma = false; - if (0 == gpsdata->raw.meas[i].svid) { + if (0 == gpsdata->raw.meas[i].svid || + 255 == gpsdata->raw.meas[i].svid) { + /* skip empty and GLONASS 255 */ continue; } str_appendf(reply, replylen, - "{\"gnssid\":%u,\"svid\":%u,\"snr\":%u,\"freqid\":%u," + "{\"gnssid\":%u,\"svid\":%u,\"snr\":%u," "\"obs\":\"%s\",\"lli\":%1u,\"locktime\":%u", gpsdata->raw.meas[i].gnssid, gpsdata->raw.meas[i].svid, - gpsdata->raw.meas[i].snr, gpsdata->raw.meas[i].freqid, + gpsdata->raw.meas[i].snr, gpsdata->raw.meas[i].obs_code, gpsdata->raw.meas[i].lli, gpsdata->raw.meas[i].locktime); if (0 < gpsdata->raw.meas[i].sigid) { str_appendf(reply, replylen, ",\"sigid\":%u", gpsdata->raw.meas[i].sigid); } + if (GNSSID_GLO == gpsdata->raw.meas[i].gnssid) { + str_appendf(reply, replylen, ",\"freqid\":%u", + gpsdata->raw.meas[i].freqid); + } comma = true; if (0 != isfinite(gpsdata->raw.meas[i].pseudorange) && |