summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-03-26 21:22:44 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-03-26 21:22:44 +0000
commit7e82d36d697d7fac55e24515861f109e4cb4e327 (patch)
tree207e7be6ab568af9738be4d88c7dbe3255dd06cf
parente96c9a2c11728e36374ea14e428909f495010ee6 (diff)
downloadgpsd-7e82d36d697d7fac55e24515861f109e4cb4e327.tar.gz
We now have a working regression test for AIS Type 8 messages...
...and evidence that (alas) Type 6 is broken.
-rw-r--r--driver_aivdm.c4
-rw-r--r--gpsdecode.xml4
-rw-r--r--test/schwehr.aivdm26
-rw-r--r--test/schwehr.aivdm.chk1
4 files changed, 31 insertions, 4 deletions
diff --git a/driver_aivdm.c b/driver_aivdm.c
index 82cbfd09..cd9c3f19 100644
--- a/driver_aivdm.c
+++ b/driver_aivdm.c
@@ -216,7 +216,7 @@ bool aivdm_decode(char *buf, size_t buflen, struct aivdm_context_t *ais_context)
break;
case 6: /* Addressed Binary Message */
ais->type6.seqno = UBITS(38, 2);
- ais->type6.dest_mmsi = UBITS(40, 69);
+ ais->type6.dest_mmsi = UBITS(40, 30);
ais->type6.retransmit = (bool)UBITS(70, 1);
ais->type6.spare = UBITS(71, 1);
ais->type6.application_id = UBITS(72, 16);
@@ -262,7 +262,7 @@ bool aivdm_decode(char *buf, size_t buflen, struct aivdm_context_t *ais_context)
break;
case 12: /* Safety Related Message */
ais->type12.seqno = UBITS(38, 2);
- ais->type12.dest_mmsi = UBITS(40, 69);
+ ais->type12.dest_mmsi = UBITS(40, 30);
ais->type12.retransmit = (bool)UBITS(70, 1);
ais->type12.spare = UBITS(71, 1);
from_sixbit((char *)ais_context->bits,
diff --git a/gpsdecode.xml b/gpsdecode.xml
index 494f1abb..6a1476e4 100644
--- a/gpsdecode.xml
+++ b/gpsdecode.xml
@@ -133,8 +133,8 @@ GPSD project website.</para>
<refsect1 id='bugs'><title>BUGS AND LIMITATIONS</title>
<para>AIDVM decoding presently only parses fields for the sentence
-types 1-9, 12-14, and 18. Decoding of types 6, 7, 8, 12, 13, and 14
-is untested. AIVDM encoding is not yet supported.</para>
+types 1-9, 12-14, and 18. Decoding of types 6, 7, 12, 13, and 14
+is unverified. AIVDM encoding is not yet supported.</para>
<para>RTCM3 decoding is buggy and incomplete.</para>
diff --git a/test/schwehr.aivdm b/test/schwehr.aivdm
index aa027df3..684037ba 100644
--- a/test/schwehr.aivdm
+++ b/test/schwehr.aivdm
@@ -127,6 +127,31 @@
# dte: 0
# Spare: 0
#
+# DOES NOT PASS yet -- some grief with the data offset.
+# Text decode for this one came from regrouping the binary data dump from Kurt's
+# ais_msg_6.py on one of his test sentences. It's unknown what's in the binary
+# data block.
+#!AIVDM,1,1,,B,6B?n;be:cbapalgc;i6?Ow4,2*4A
+# MessageID: 6
+# RepeatIndicator: 1
+# UserID: 150834090
+# SeqNum: 3
+# DestinationID: 313240222
+# RetransmitFlag: False
+# Spare: 0
+# ApplicationID: 42827
+# Data: 50:3acbc463dffc4
+#
+# Text decode for this one came from regrouping the binary data dump from Kurt's
+# ais_msg_8.py on one of his test sentences. It's unknown what's in the binary
+# data block.
+!AIVDM,1,1,,A,85Mwp`1Kf3aCnsNvBWLi=wQuNhA5t43N`5nCuI=p<IBfVqnMgPGs,0*47
+# MessageID: 8
+# RepeatIndicator: 0
+# UserID: 366999712
+# ApplicationID: 23480
+# Data: 256:3a53dbb7be4a773137f87d7b0445f040dea05d93f593783194ae9b9d9dbe05fb
+#
# This sentence is slightly malformed -- extra data at the end.
!AIVDM,1,1,,B,9wsh:3?h>TdcWHftni=J0d5fs?8WT852,5*74
# MessageID: 9
@@ -146,6 +171,7 @@
# state_syncstate: 2
# state_slottimeout: 3
# state_slotoffset: 12839
+#
!AIVDM,1,1,,A,B52K>;h00Fc>jpUlNV@ikwpUoP06,0*4C
# MessageID: 18
# RepeatIndicator: 0
diff --git a/test/schwehr.aivdm.chk b/test/schwehr.aivdm.chk
index f09ffa86..4cdbb480 100644
--- a/test/schwehr.aivdm.chk
+++ b/test/schwehr.aivdm.chk
@@ -4,5 +4,6 @@
3,1,563808000,Moored,0,0.0,1,-76.3275,36.9100,2520,352,35,0,0,0
4,0,003669702,2007:05:14T19:57:39Z,1,36.8838,-76.3524,Surveyed,0,105df
4,0,003669702,2007:05:14T19:57:39Z,1,36.8838,-76.3524,Surveyed,0,105df
+8,0,366999712,23480,256:3a53dbb7be4a773137f87d7b0445f040dea05d93f593783194ae9b9d9dbe05fb
9,3,1069287948,4032,932,1,177.3001,106.3532,256.2,48,5b,1,1,2cf227
18,0,338087471,0,0.1,0,-74.0721,40.6845,79.6,511,49,0,1,e0006