summaryrefslogtreecommitdiff
path: root/gps.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-18 07:41:36 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-18 07:41:36 -0400
commite11a617ab0943bfad775f051a1b256010132a420 (patch)
tree894addb33e13c13f2a10ed4a38bc489a20eb0973 /gps.h
parent5398d10dc20ef7433818f422396b80475b6a8b22 (diff)
downloadgpsd-e11a617ab0943bfad775f051a1b256010132a420.tar.gz
Sort out some issues with PRN handling.
Add macros for classifying PRNs into GPS, GLONASS, DGPS. Document the PRN ranges on the gps_json manual page. It turns out that U.S. GPS authorities reserve 1-64 for GPS birds, not just 1-32. So the way we map GLONASS PRNs had to change. This required a regression-test rebuild for the geostar driver.
Diffstat (limited to 'gps.h')
-rw-r--r--gps.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gps.h b/gps.h
index 4ecce8ec..bf3c3f92 100644
--- a/gps.h
+++ b/gps.h
@@ -96,6 +96,17 @@ struct gps_fix_t {
double epc; /* Vertical speed uncertainty */
};
+/*
+ * Satellite ID classes.
+ * U.S. GPS authorities reserve PRNs 1-64 for GPS satellites.
+ * GLONASS birds reuse GPS PRNs; it is a GPSD convention to map them to
+ * IDs 64 and above (some other programs push them to 33 and above).
+ * All SBAS/WAAS/EGNOS birds have PRNs above 100.
+ */
+#define GNSS_PRN(n) (((n) >= 1) && ((n) <= 63)) /* GNSS satellite */
+#define GLONASS_PRN(n) (((n) >= 64) && ((n) <= 96)) /* GLONASS satellite */
+#define DGPS_PRN(n) ((n) >= 100)
+
/*
* The structure describing the pseudorange errors (GPGST)
*/