diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-10-25 14:32:16 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-10-25 14:32:16 +0000 |
commit | 8edf48fe3601b15ce451d98a5411bb3101c2c4e6 (patch) | |
tree | e68a4fcc3fd74329b808686e6817c39c71d97b7f /libgpsd_core.c | |
parent | 269bf3e09ea8e622c9e6af23fb8d48e26f33504a (diff) | |
download | gpsd-8edf48fe3601b15ce451d98a5411bb3101c2c4e6.tar.gz |
Correct scaling in PGRME output.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index 940091f7..f71e8ca4 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -405,12 +405,16 @@ static void gpsd_binary_quality_dump(struct gps_device_t *session, if (finite(session->gpsdata.fix.eph) || finite(session->gpsdata.fix.epv) || finite(session->gpsdata.epe)) { - /* output PGRME only if realistic */ + /* + * Output PGRME only if realistic. Note: we're converting back to + * our guess about Garmin's confidence units here, make sure this + * stays consistent with the in-conversion in nmea_parse.c! + */ (void)snprintf(bufp, len-strlen(bufp), "$PGRME,%.2f,M,%.2f,M,%.2f,M", - ZEROIZE(session->gpsdata.fix.eph), - ZEROIZE(session->gpsdata.fix.epv), - ZEROIZE(session->gpsdata.epe)); + ZEROIZE(session->gpsdata.fix.eph * (CEP50_SIGMA/GPSD_CONFIDENCE)), + ZEROIZE(session->gpsdata.fix.epv * (CEP50_SIGMA/GPSD_CONFIDENCE)), + ZEROIZE(session->gpsdata.epe * (CEP50_SIGMA/GPSD_CONFIDENCE))); nmea_add_checksum(bufp); } #undef ZEROIZE |