summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-25 14:32:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-25 14:32:16 +0000
commit8edf48fe3601b15ce451d98a5411bb3101c2c4e6 (patch)
treee68a4fcc3fd74329b808686e6817c39c71d97b7f /libgpsd_core.c
parent269bf3e09ea8e622c9e6af23fb8d48e26f33504a (diff)
downloadgpsd-8edf48fe3601b15ce451d98a5411bb3101c2c4e6.tar.gz
Correct scaling in PGRME output.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c12
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