summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-19 04:05:16 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-19 04:05:16 -0400
commit6129737a0805c17c36ce2984605b14c5a00a0d11 (patch)
tree610fdd5a36bead0bd5039d6b4044609046c21b6f /test
parent1bb68f622980eb1daf3cd7d4ed189f31522e937f (diff)
downloadgpsd-6129737a0805c17c36ce2984605b14c5a00a0d11.tar.gz
Prevent false matching of the Inland AIS shape on unstructured Type 8s.
Also, add a regression test for this.
Diffstat (limited to 'test')
-rw-r--r--test/sample.aivdm14
-rw-r--r--test/sample.aivdm.chk1
-rw-r--r--test/sample.aivdm.js.chk1
-rw-r--r--test/sample.aivdm.ju.chk1
4 files changed, 17 insertions, 0 deletions
diff --git a/test/sample.aivdm b/test/sample.aivdm
index 5a93d9ba..70b7d94c 100644
--- a/test/sample.aivdm
+++ b/test/sample.aivdm
@@ -450,6 +450,20 @@
# course_q : false
# heading_q : false
#
+# This is a Type 8 blob that spoofs being Inland AIS Ship Static data.
+# but has garbage in the shiptype, vin, and other fields.
+# Curiously, it seems to have been emitted by the same ship (or, anyway,
+# the same MMSI) as the previous and valid one.
+# Paul Courbis <paul@courbis.com>
+!AIVDM,2,1,4,A,83aDChPj2d<dL<uM=hhhI?a@6HP0e9QvUEEEOPPrE4t880>p2JqA6wimt:Ow,0*22
+!AIVDM,2,2,4,A,UPP8k;JvOeD,2*7F
+# Message type : 8
+# Repleat Indicator : 0
+# MMSI : 244650946
+# DAC : 200
+# FID : 10
+# data : 368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5
+#
# Type 9:
# From AISHub. Checked with the noaadata tools.
!AIVDM,1,1,,A,91b77=h3h00nHt0Q3r@@07000<0b,0*69
diff --git a/test/sample.aivdm.chk b/test/sample.aivdm.chk
index 2df3d918..f8885e7d 100644
--- a/test/sample.aivdm.chk
+++ b/test/sample.aivdm.chk
@@ -19,6 +19,7 @@
8|0|992509977|1|11|-368037|3197689|18T17:45Z|127|127|511|511|2047|127|1023|511|3|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3
8|0|992509977|1|31|-368044|3197696|29T23:24Z|127|127|360|360|-1024|101|501|511|3|127|4001|3|255|360|255|360|31|255|360|31|255|63|360|255|63|360|13|501|7|510|3
8|0|244650946|200|10|112:3032313033353437000000008601
+8|0|244650946|200|10|368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5
9|0|111265591|15|0|0|7128960|34667073|0|28|0x0|0|0|0x6015
10|0|366814480|366832740
10|0|440882000|366972000
diff --git a/test/sample.aivdm.js.chk b/test/sample.aivdm.js.chk
index df238041..70eda232 100644
--- a/test/sample.aivdm.js.chk
+++ b/test/sample.aivdm.js.chk
@@ -19,6 +19,7 @@
{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992509977,"scaled":true,"dac":1,"fid":11,"lat":53.295,"lon":-6.134,"timestamp":"18T17:45Z","wspeed":127,"wgust":127,"wdir":511,"wgustdir":511,"humidity":127,"airtemp":144.7,"dewpoint":82.3,"pressure":1311,"pressuretend":"N/A","visibility":25.5,"waterlevel":41.1,"leveltrend":"N/A","cspeed":25.5,"cdir":511,"cspeed2":25.5,"cdir2":511,"cdepth2":31,"cspeed3":25.5,"cdir3":511,"cdepth3":31,"waveheight":25.5,"waveperiod":63,"wavedir":511,"swellheight":25.5,"swellperiod":63,"swelldir":511,"seastate":15,"watertemp":92.3,"preciptype":7,"preciptype_text":"N/A","salinity":51.1,"ice":3,"ice_text":"N/A"}
{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992509977,"scaled":true,"dac":1,"fid":31,"lat":53.295,"lon":-6.134,"accuracy":false,"timestamp":"29T23:24Z","wspeed":127,"wgust":127,"wdir":360,"wgustdir":360,"humidity":101,"airtemp":-102.4,"dewpoint":50.1,"pressure":1310,"pressuretend":"N/A","visgreater":false,"visibility":12.7,"waterlevel":30.0,"leveltrend":"N/A","cspeed":25.5,"cdir":360,"cspeed2":25.5,"cdir2":360,"cdepth2":31,"cspeed3":25.5,"cdir3":360,"cdepth3":31,"waveheight":25.5,"waveperiod":63,"wavedir":360,"swellheight":25.5,"swellperiod":63,"swelldir":360,"seastate":13,"watertemp":50.1,"preciptype":"N/A","salinity":51.0,"ice":"N/A"}
{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":244650946,"scaled":true,"dac":200,"fid":10,"vin":"02103547","length":390,"beam":50,"shiptype":8010,"shiptype_text":"Motor freighter","hazard":0,"hazard_text":"0 blue cones/lights","draught":204,"loaded":1,"loaded_text":"Unloaded","speed_q":false,"course_q":false,"heading_q":false}
+{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":244650946,"scaled":true,"dac":200,"fid":10,"data":"368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5"}
{"class":"AIS","device":"stdin","type":9,"repeat":0,"mmsi":111265591,"scaled":true,"alt":15,"speed":0,"accuracy":false,"lon":11.8816,"lat":57.7785,"course":0.0,"second":28,"regional":0,"dte":0,"raim":false,"radio":24597}
{"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":366814480,"scaled":true,"dest_mmsi":366832740}
{"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":440882000,"scaled":true,"dest_mmsi":366972000}
diff --git a/test/sample.aivdm.ju.chk b/test/sample.aivdm.ju.chk
index 110bbabd..7508d2f8 100644
--- a/test/sample.aivdm.ju.chk
+++ b/test/sample.aivdm.ju.chk
@@ -19,6 +19,7 @@
{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992509977,"scaled":false,"dac":1,"fid":11,"lat":3197689,"lon":-368037,"timestamp":"18T17:45Z","wspeed":127,"wgust":127,"wdir":511,"wgustdir":511,"humidity":127,"airtemp":2047,"dewpoint":1023,"pressure":511,"pressuretend":3,"visibility":255,"waterlevel":511,"leveltrend":3,"cspeed":255,"cdir":511,"cspeed2":255,"cdir2":511,"cdepth2":31,"cspeed3":255,"cdir3":511,"cdepth3":31,"waveheight":255,"waveperiod":63,"wavedir":511,"swellheight":255,"swellperiod":63,"swelldir":511,"seastate":15,"watertemp":1023,"preciptype":7,"preciptype_text":"N/A","salinity":511,"ice":3,"ice_text":"N/A"}
{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992509977,"scaled":false,"dac":1,"fid":31,"lat":3197696,"lon":-368044,"accuracy":false,"timestamp":"29T23:24Z","wspeed":127,"wgust":127,"wdir":360,"wgustdir":360,"humidity":101,"airtemp":-1024,"dewpoint":501,"pressure":511,"pressuretend":3,"visgreater":false,"visibility":127,"waterlevel":4001,"leveltrend":3,"cspeed":255,"cdir":360,"cspeed2":255,"cdir2":360,"cdepth2":31,"cspeed3":255,"cdir3":360,"cdepth3":31,"waveheight":255,"waveperiod":63,"wavedir":360,"swellheight":255,"swellperiod":63,"swelldir":360,"seastate":13,"watertemp":501,"preciptype":7,"salinity":510,"ice":3}
{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":244650946,"scaled":false,"dac":200,"fid":10,"vin":"02103547","length":390,"beam":50,"shiptype":8010,"shiptype_text":"Motor freighter","hazard":0,"hazard_text":"0 blue cones/lights","draught":204,"loaded":1,"loaded_text":"Unloaded","speed_q":false,"course_q":false,"heading_q":false}
+{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":244650946,"scaled":false,"dac":200,"fid":10,"data":"368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5"}
{"class":"AIS","device":"stdin","type":9,"repeat":0,"mmsi":111265591,"scaled":false,"alt":15,"speed":0,"accuracy":false,"lon":7128960,"lat":34667073,"course":0,"second":28,"regional":0,"dte":0,"raim":false,"radio":24597}
{"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":366814480,"scaled":false,"dest_mmsi":366832740}
{"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":440882000,"scaled":false,"dest_mmsi":366972000}