summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-01-30 16:09:14 +0000
committerEric S. Raymond <esr@thyrsus.com>2010-01-30 16:09:14 +0000
commit0a85df3e226d3395c43f3a199b918403607c3068 (patch)
treebdd02e8f75943865cd0d8e5e4a3eeccba0a540e3
parent0bed86e660ebd70a5f41fac369f5a2e680bd70ca (diff)
downloadgpsd-0a85df3e226d3395c43f3a199b918403607c3068.tar.gz
Add AIS type 23 regression test.
Also fix type 16 interpretation in the Python decoder.
-rwxr-xr-xdevtools/ais.py10
-rw-r--r--test/sample.aivdm19
-rw-r--r--test/sample.aivdm.chk1
3 files changed, 25 insertions, 5 deletions
diff --git a/devtools/ais.py b/devtools/ais.py
index 44a8f44e..0700e5f5 100755
--- a/devtools/ais.py
+++ b/devtools/ais.py
@@ -406,13 +406,13 @@ type15 = (
type16 = (
spare(2),
- bitfield("mmsi1", 30, 'unsigned', 0, "Interrogated MMSI"),
+ bitfield("mmsi1", 30, 'unsigned', 0, "Interrogated MMSI 1"),
bitfield("offset1 ", 12, 'unsigned', 0, "First slot offset"),
- bitfield("increment1",10, 'unsigned', 0, "Slot increment"),
+ bitfield("increment1",10, 'unsigned', 0, "First slot increment"),
spare(2),
- bitfield("mmsi2", 30, 'unsigned', 0, "Interrogated MMSI"),
- bitfield("offset2", 12, 'unsifned', 0, "First slot offset"),
- bitfield("increment2",10, 'unsigned', 0, "Slot increment"),
+ bitfield("mmsi2", 30, 'unsigned', 0, "Interrogated MMSI 2"),
+ bitfield("offset2", 12, 'unsigned', 0, "Second slot offset"),
+ bitfield("increment2",10, 'unsigned', 0, "Second slot increment"),
spare(2),
)
diff --git a/test/sample.aivdm b/test/sample.aivdm
index 0c3c42df..a3f72fd5 100644
--- a/test/sample.aivdm
+++ b/test/sample.aivdm
@@ -501,6 +501,8 @@
# Type 22:
# From AISHub. Broadcast case: we won't count this as a full test by
# itself because the bit layout of the addressed case is different.
+# (The addressed form seems to be rare or nonexistent in the wild; none
+# showed up in a three-hour sample from AISHub, while many broadcasts did.)
# Verified only by the fact that the Python and C decoders get consistent
# results, we haven't actually seen an independent dump of these fields.
# (The noaadata 0.42 dumper for this type doesn't seem to work.)
@@ -521,6 +523,23 @@
# Channel A Band : 0
# Zone size : 4
#
+# Type 23:
+# From AISHub. Only a regression test to check that the C and Python decoders
+# do the same thing, not yet checked against other decoders.
+!AIVDM,1,1,,B,G02:Kn01R`sn@291nj600000900,2*12
+# Message Type : 23
+# Repeat Indicator : 0
+# MMSI : 2268120
+# NE Longitude : 1578
+# NE Latitude : 30642
+# SW Longitude : 1096
+# SW Latitude : 30408
+# Station Type : 6
+# Ship Type : 0
+# Tx/Rx mode : 0
+# Reporting interval : 9
+# Quiet time : 0
+#
# Type 24:
# One pair of type A and Type B messages. Note, these have Coast Guard
# extended fields after them.
diff --git a/test/sample.aivdm.chk b/test/sample.aivdm.chk
index 81ad1ee9..91a7f6b7 100644
--- a/test/sample.aivdm.chk
+++ b/test/sample.aivdm.chk
@@ -33,4 +33,5 @@
20,0,003160097,47,1,7,250,2250,1,7,1125,856,5,7,1125,0,0,0,0
21,0,123456789,20,CHINA ROSE MURPHY EXPRESS ALERT,0,-73619155,28752371,5,5,5,5,1,50,165,0x0,0,0
22,0,003160048,2087,2088,0,0,-44100,27330,-48100,25400,0,0,0,4
+23,0,002268120,1578,30642,1096,30408,6,0,2,9,0
24,2,338085242,CAPTAIN`S PARADISE,54,ACR1234,WDD7883,8,3,2,1