summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-02-08 19:09:14 -0800
committerGary E. Miller <gem@rellim.com>2018-02-08 19:09:14 -0800
commitdd18103237b7089114aa6830f2abe85fb3420fde (patch)
tree4d1f5b12a4657c5f186ba57495776306db286dc0 /gpsd_json.c
parent9f6d73c779168a6ec276b02a3d08ece8bfc15d51 (diff)
downloadgpsd-dd18103237b7089114aa6830f2abe85fb3420fde.tar.gz
Add ECEF support to u-blocx driver, data comes out in json.
More work to do so cgps, xgps, etc. see the new data.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 825851e3..cfc4412c 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -189,8 +189,36 @@ void json_tpv_dump(const struct gps_device_t *session,
str_appendf(reply, replylen, "\"epd\":%.4f,", gpsdata->fix.epd);
if (isnan(gpsdata->fix.eps) == 0)
str_appendf(reply, replylen, "\"eps\":%.2f,", gpsdata->fix.eps);
- if ((gpsdata->fix.mode >= MODE_3D) && isnan(gpsdata->fix.epc) == 0)
- str_appendf(reply, replylen, "\"epc\":%.2f,", gpsdata->fix.epc);
+ if (gpsdata->fix.mode >= MODE_3D) {
+ if (isnan(gpsdata->fix.epc) == 0)
+ str_appendf(reply, replylen, "\"epc\":%.2f,", gpsdata->fix.epc);
+ if ( 1 || gpsdata->fix.ecef.valid) {
+ if (0 == isnan(gpsdata->fix.ecef.x))
+ str_appendf(reply, replylen, "\"ecefx\":%.2f,",
+ gpsdata->fix.ecef.x);
+ if (0 == isnan(gpsdata->fix.ecef.y))
+ str_appendf(reply, replylen, "\"ecefy\":%.2f,",
+ gpsdata->fix.ecef.y);
+ if (0 == isnan(gpsdata->fix.ecef.z))
+ str_appendf(reply, replylen, "\"ecefz\":%.2f,",
+ gpsdata->fix.ecef.z);
+ if (0 == isnan(gpsdata->fix.ecef.vx))
+ str_appendf(reply, replylen, "\"ecefvx\":%.2f,",
+ gpsdata->fix.ecef.vx);
+ if (0 == isnan(gpsdata->fix.ecef.vy))
+ str_appendf(reply, replylen, "\"ecefvy\":%.2f,",
+ gpsdata->fix.ecef.vy);
+ if (0 == isnan(gpsdata->fix.ecef.vz))
+ str_appendf(reply, replylen, "\"ecefvz\":%.2f,",
+ gpsdata->fix.ecef.vz);
+ if (0 == isnan(gpsdata->fix.ecef.pAcc))
+ str_appendf(reply, replylen, "\"ecefpAcc\":%.2f,",
+ gpsdata->fix.ecef.pAcc);
+ if (0 == isnan(gpsdata->fix.ecef.vAcc))
+ str_appendf(reply, replylen, "\"ecefvAcc\":%.2f,",
+ gpsdata->fix.ecef.vAcc);
+ }
+ }
#ifdef TIMING_ENABLE
if (policy->timing) {
char rtime_str[TIMESPEC_LEN];