summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-04 14:01:55 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-04 14:01:55 +0000
commit4297add959f50e172a13be374a4ab039b21d93da (patch)
tree4a18fa49e523de40998b305be7540ba22061d406 /libgpsd_core.c
parentab049fc32676041a7fe2a16abd6cc9dea9f49255 (diff)
downloadgpsd-4297add959f50e172a13be374a4ab039b21d93da.tar.gz
Be aware of WAAS satellites.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index f8bb839d..2b63fb42 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -381,7 +381,22 @@ static void apply_error_model(struct gps_device_t *session)
/* only used if the GPS doesn't report estimated position error itself */
#define UERE_NO_DGPS 8.0 /* meters */
#define UERE_WITH_DGPS 2.0 /* meters */
- double uere = ((session->context->dsock<0) ? UERE_NO_DGPS : UERE_WITH_DGPS);
+ double uere;
+ int i;
+ bool waas_active = false;
+ bool dgps_active = (session->context->dsock<0);
+
+ /*
+ * If we have a satellite picture that includes a WAAS/Egnos PRN,
+ * it will ship DGPS corrections. Note: this assumes only WAAS-capable
+ * GPSes can see these PRNs at all.
+ */
+ if (session->gpsdata.set & SATELLITE_SET)
+ for (i = 0; i < session->gpsdata.satellites; i++)
+ if (session->gpsdata.PRN[i] > 32)
+ waas_active = true;
+
+ uere = ((dgps_active || waas_active) ? UERE_NO_DGPS : UERE_WITH_DGPS);
session->gpsdata.fix.ept = 0.005;
if ((session->gpsdata.set & HERR_SET)==0