diff options
author | Gary E. Miller <gem@rellim.com> | 2018-11-12 13:33:12 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-11-12 13:33:12 -0800 |
commit | b3f9c362febdb328191eec4aaeaf5ebad2cba57f (patch) | |
tree | ede672a91440d9a0438a78d49b748cd8fbb45de9 /gpsd_json.c | |
parent | 60eb6d238f4c4c77d6945efbfada3272ad161111 (diff) | |
download | gpsd-b3f9c362febdb328191eec4aaeaf5ebad2cba57f.tar.gz |
RAW: Add c2c and l2c measurements.
Those are C/A L2 pseudo-range and carrierphase.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index b38a3668..07f1ecd3 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -754,17 +754,19 @@ void json_raw_dump(const struct gps_data_t *gpsdata, gpsdata->raw.meas[i].locktime); comma = true; - if (0 != isfinite(gpsdata->raw.meas[i].carrierphase)) { - str_appendf(reply, replylen, ",\"carrierphase\":%f", - gpsdata->raw.meas[i].carrierphase); - comma = true; - } - if (0 != isfinite(gpsdata->raw.meas[i].pseudorange)) { + if (0 != isfinite(gpsdata->raw.meas[i].pseudorange) && + 1.0 < gpsdata->raw.meas[i].pseudorange) { if (comma) (void)strlcat(reply, ",", replylen); str_appendf(reply, replylen, "\"pseudorange\":%f", gpsdata->raw.meas[i].pseudorange); comma = true; + + if (0 != isfinite(gpsdata->raw.meas[i].carrierphase)) { + str_appendf(reply, replylen, ",\"carrierphase\":%f", + gpsdata->raw.meas[i].carrierphase); + comma = true; + } } if (0 != isfinite(gpsdata->raw.meas[i].doppler)) { if (comma) @@ -774,6 +776,24 @@ void json_raw_dump(const struct gps_data_t *gpsdata, comma = true; } + /* L2 C/A pseudo range, RINEX C2C */ + if (0 != isfinite(gpsdata->raw.meas[i].c2c) && + 1.0 < gpsdata->raw.meas[i].c2c) { + if (comma) + (void)strlcat(reply, ",", replylen); + str_appendf(reply, replylen, "\"c2c\":%f", + gpsdata->raw.meas[i].c2c); + comma = true; + + /* L2 C/A carrier phase, RINEX L2C */ + if (0 != isfinite(gpsdata->raw.meas[i].l2c)) { + if (comma) + (void)strlcat(reply, ",", replylen); + str_appendf(reply, replylen, "\"l2c\":%f", + gpsdata->raw.meas[i].l2c); + comma = true; + } + } (void)strlcat(reply, "},", replylen); } str_rstrip_char(reply, ','); |