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 /libgpsd_core.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 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index 22e2fc77..da1866f2 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -1024,9 +1024,16 @@ static void gpsd_error_model(struct gps_device_t *session) fix->epv = session->gpsdata.dop.vdop * v_uere; } - if (0 == isfinite(fix->epe) && + /* 2D error */ + if (0 == isfinite(fix->eph) && + 0 != isfinite(session->gpsdata.dop.hdop)) { + fix->eph = session->gpsdata.dop.hdop * p_uere; + } + + /* 3D error */ + if (0 == isfinite(fix->sep) && 0 != isfinite(session->gpsdata.dop.pdop)) { - fix->epe = session->gpsdata.dop.pdop * p_uere; + fix->sep = session->gpsdata.dop.pdop * p_uere; } /* |