summaryrefslogtreecommitdiff
path: root/gps.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-05-28 08:46:52 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-05-28 08:46:52 +0000
commit88c1095700fefac22d1db3ac7b11d551d992142b (patch)
treee7b223f26e271b0187267ecfa4542959a0bfeb10 /gps.h
parent4841c90d028c3124487aeb7c1075edd7642e1698 (diff)
downloadgpsd-88c1095700fefac22d1db3ac7b11d551d992142b.tar.gz
Correct the test for auxiliary-craft MMSI.
Diffstat (limited to 'gps.h')
-rw-r--r--gps.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/gps.h b/gps.h
index 50c857e3..c5b6658c 100644
--- a/gps.h
+++ b/gps.h
@@ -446,8 +446,14 @@ struct rtcm3_t {
typedef /*@unsignedintegraltype@*/ unsigned int gps_mask_t;
-/* Is an MMSI number that of an auxiliary associated with a mother ship? */
-#define AIS_AUXILIARY_MMSI(n) ((n) / 100000 == 98)
+/*
+ * Is an MMSI number that of an auxiliary associated with a mother ship?
+ * We need to be able to test this for decoding AIS Type 24 messages.
+ * According to <http://www.navcen.uscg.gov/marcomms/gmdss/mmsi.htm#format>,
+ * auxiliary-craft MMSIs have the form 98MIDXXXX, where MID is a country
+ * code and XXXX the vessel ID.
+ */
+#define AIS_AUXILIARY_MMSI(n) ((n) / 10000000 == 98)
struct ais_t
{