diff options
author | Gary E. Miller <gem@rellim.com> | 2019-03-22 20:17:48 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-03-22 20:17:48 -0700 |
commit | 259196e2ece002ff63a0da1831a90e6c0b74ea7f (patch) | |
tree | 02380d00b2932c39138fe27d9ef1f7bf61db6aa4 /gpsutils.c | |
parent | 3d1b7493c58f80a93b9bbec33717fd3055841ae1 (diff) | |
download | gpsd-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 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 40 |
1 files changed, 22 insertions, 18 deletions
@@ -246,23 +246,24 @@ void gps_clear_fix(struct gps_fix_t *fixp) /* stuff a fix structure with recognizable out-of-band values */ { memset(fixp, 0, sizeof(struct gps_fix_t)); - fixp->time = NAN; - fixp->mode = MODE_NOT_SEEN; - fixp->latitude = NAN; - fixp->longitude = NAN; - fixp->track = NAN; - fixp->magnetic_track = NAN; - fixp->speed = NAN; - fixp->climb = NAN; fixp->altitude = NAN; + fixp->climb = NAN; + fixp->epc = NAN; + fixp->epd = NAN; + fixp->eph = NAN; + fixp->eps = NAN; fixp->ept = NAN; + fixp->epv = NAN; fixp->epx = NAN; fixp->epy = NAN; - fixp->epv = NAN; - fixp->epd = NAN; - fixp->eps = NAN; - fixp->epc = NAN; - fixp->epe = NAN; + fixp->latitude = NAN; + fixp->longitude = NAN; + fixp->magnetic_track = NAN; + fixp->mode = MODE_NOT_SEEN; + fixp->sep = NAN; + fixp->speed = NAN; + fixp->time = NAN; + fixp->track = NAN; /* clear ECEF too */ fixp->ecef.x = NAN; fixp->ecef.y = NAN; @@ -333,14 +334,17 @@ void gps_merge_fix(struct gps_fix_t *to, to->epx = from->epx; to->epy = from->epy; } - if (0 != isfinite(from->eps)) { - to->eps = from->eps; - } if (0 != isfinite(from->epd)) { to->epd = from->epd; } - if (0 != isfinite(from->epe)) { - to->epe = from->epe; + if (0 != isfinite(from->eph)) { + to->eph = from->eph; + } + if (0 != isfinite(from->eps)) { + to->eps = from->eps; + } + if (0 != isfinite(from->sep)) { + to->sep = from->sep; } if ((transfer & VERR_SET) != 0) to->epv = from->epv; |