summaryrefslogtreecommitdiff
path: root/libgps_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-03-22 20:17:48 -0700
committerGary E. Miller <gem@rellim.com>2019-03-22 20:17:48 -0700
commit259196e2ece002ff63a0da1831a90e6c0b74ea7f (patch)
tree02380d00b2932c39138fe27d9ef1f7bf61db6aa4 /libgps_json.c
parent3d1b7493c58f80a93b9bbec33717fd3055841ae1 (diff)
downloadgpsd-259196e2ece002ff63a0da1831a90e6c0b74ea7f.tar.gz
Split epe into eph and sep.
Try to do it with forward and backward compatibility, which is challenging with current miscojson. Sometimes epe was used to 2D estimated erro. Sometimes for 3D error. So make it explicit eph is 2D, and sep is 3D.
Diffstat (limited to 'libgps_json.c')
-rw-r--r--libgps_json.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/libgps_json.c b/libgps_json.c
index 517f7294..498196e9 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -35,7 +35,8 @@ PERMISSIONS
static int json_tpv_read(const char *buf, struct gps_data_t *gpsdata,
const char **endptr)
{
- int leapseconds;
+ int leapseconds; /* FIXME, unused... */
+ double epe; /* obsolete, for back compatibility */
const struct json_attr_t json_attrs_1[] = {
/* *INDENT-OFF* */
@@ -56,12 +57,19 @@ static int json_tpv_read(const char *buf, struct gps_data_t *gpsdata,
.dflt.real = NAN},
{"alt", t_real, .addr.real = &gpsdata->fix.altitude,
.dflt.real = NAN},
+ {"epc", t_real, .addr.real = &gpsdata->fix.epc,
+ .dflt.real = NAN},
+ {"epd", t_real, .addr.real = &gpsdata->fix.epd,
+ .dflt.real = NAN},
+ {"epe", t_real, .addr.real = &epe, .dflt.real = NAN},
+ {"eph", t_real, .addr.real = &gpsdata->fix.eph,
+ .dflt.real = NAN},
+ {"eps", t_real, .addr.real = &gpsdata->fix.eps,
+ .dflt.real = NAN},
{"epx", t_real, .addr.real = &gpsdata->fix.epx,
.dflt.real = NAN},
{"epy", t_real, .addr.real = &gpsdata->fix.epy,
.dflt.real = NAN},
- {"epe", t_real, .addr.real = &gpsdata->fix.epe,
- .dflt.real = NAN},
{"epv", t_real, .addr.real = &gpsdata->fix.epv,
.dflt.real = NAN},
{"track", t_real, .addr.real = &gpsdata->fix.track,
@@ -72,12 +80,6 @@ static int json_tpv_read(const char *buf, struct gps_data_t *gpsdata,
.dflt.real = NAN},
{"climb", t_real, .addr.real = &gpsdata->fix.climb,
.dflt.real = NAN},
- {"epd", t_real, .addr.real = &gpsdata->fix.epd,
- .dflt.real = NAN},
- {"eps", t_real, .addr.real = &gpsdata->fix.eps,
- .dflt.real = NAN},
- {"epc", t_real, .addr.real = &gpsdata->fix.epc,
- .dflt.real = NAN},
{"ecefx", t_real, .addr.real = &gpsdata->fix.ecef.x,
.dflt.real = NAN},
{"ecefy", t_real, .addr.real = &gpsdata->fix.ecef.y,
@@ -96,6 +98,8 @@ static int json_tpv_read(const char *buf, struct gps_data_t *gpsdata,
.dflt.real = NAN},
{"mode", t_integer, .addr.integer = &gpsdata->fix.mode,
.dflt.integer = MODE_NOT_SEEN},
+ {"sep", t_real, .addr.real = &gpsdata->fix.sep,
+ .dflt.real = NAN},
{"status", t_integer, .addr.integer = &gpsdata->status,
.dflt.integer = STATUS_FIX},
{NULL},