add an ais type9 sample which has speed
authorJon Schlueter <jschlueter@redhat.com>
Tue, 6 Oct 2015 02:01:49 +0000 (22:01 -0400)
committerJon Schlueter <jschlueter@redhat.com>
Tue, 6 Oct 2015 02:02:18 +0000 (22:02 -0400)
Type 9: the ais->type9.speed field should be used instead of the type1 field

Identifed by: Stefan Roels <sroels-gpsd-dev@42solutions.nl>

gpsd_json.c
test/sample.aivdm
test/sample.aivdm.chk
test/sample.aivdm.js.chk
test/sample.aivdm.ju.chk

index 6641846..9ccad3d 100644 (file)
@@ -2804,7 +2804,7 @@ void json_aivdm_dump(const struct ais_t *ais,
                (void)strlcpy(speedlegend, "\"fast\"", sizeof(speedlegend));
            else
                (void)snprintf(speedlegend, sizeof(speedlegend),
-                              "%u", ais->type1.speed);
+                              "%u", ais->type9.speed);
 
            str_appendf(buf, buflen,
                           "\"alt\":%s,\"speed\":%s,\"accuracy\":%s,"
index cc413c3..8321f73 100644 (file)
 #       RAIM flag                : 0
 #       Radio status             : 24597
 #
+# Type 9:
+# From AISHub
+!AIVDM,1,1,,B,91b55wi;hbOS@OdQAC062Ch2089h,0*30
+#       Message Type             : 9
+#       Repeat Indicator         : 0
+#       MMSI                     : 111232511
+#       Altitude                 : 303
+#       SOG                      : 42
+#       Position Accuracy        : 0
+#       Longitude                : 0xFC683F6 (-6.27884)
+#       Latitude                 : 0x2145300 ( 58.144 )
+#       Course Over Ground       : 0x0609 (154.5)
+#       Time Stamp               : 15
+#       Regional reserved        : 0
+#       DTE                      : 1
+#       Assigned                 : 0
+#       RAIM flag                : 0
+#       Radio status             : 33392
+#
 # Type 10:
 # From Kurt Schwehr. Two destination MMSIs. Checked with the noaadata tools.
 !AIVDM,1,1,,B,:5MlU41GMK6@,0*6C
index 6951630..b8c188b 100644 (file)
@@ -21,6 +21,7 @@
 8|0|244650946|200|10|112:3032313033353437000000008601\r
 8|0|244650946|200|10|368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5\r
 9|0|111265591|15|0|0|7128960|34667073|0|28|0x0|0|0|0xc02a\r
+9|0|111232511|303|42|0|-3767306|34886400|1545|15|0x0|1|0|0x8270\r
 10|0|366814480|366832740\r
 10|0|440882000|366972000\r
 11|0|304137000|2009-05-22T02:22:40Z|1|-56644610|17045470|1|0|0x0\r
index 601b149..8671140 100644 (file)
@@ -21,6 +21,7 @@
 {"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}\r
 {"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":244650946,"scaled":true,"dac":200,"fid":10,"data":"368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5"}\r
 {"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":49194}\r
+{"class":"AIS","device":"stdin","type":9,"repeat":0,"mmsi":111232511,"scaled":true,"alt":303,"speed":42,"accuracy":false,"lon":-6.2788,"lat":58.1440,"course":154.5,"second":15,"regional":0,"dte":1,"raim":false,"radio":33392}\r
 {"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":366814480,"scaled":true,"dest_mmsi":366832740}\r
 {"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":440882000,"scaled":true,"dest_mmsi":366972000}\r
 {"class":"AIS","device":"stdin","type":11,"repeat":0,"mmsi":304137000,"scaled":true,"timestamp":"2009-05-22T02:22:40Z","accuracy":true,"lon":-94.4077,"lat":28.4091,"epfd":1,"epfd_text":"GPS","raim":false,"radio":0}\r
index 00e2dce..2e77635 100644 (file)
@@ -21,6 +21,7 @@
 {"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}\r
 {"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":244650946,"scaled":false,"dac":200,"fid":10,"data":"368:c32c70cf5d370c3064fa50198800b4987e9555557e083a544f082003b809ae511bfc75f0a7ff960808ccb6be7ed5"}\r
 {"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":49194}\r
+{"class":"AIS","device":"stdin","type":9,"repeat":0,"mmsi":111232511,"scaled":false,"alt":303,"speed":42,"accuracy":false,"lon":-3767306,"lat":34886400,"course":1545,"second":15,"regional":0,"dte":1,"raim":false,"radio":33392}\r
 {"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":366814480,"scaled":false,"dest_mmsi":366832740}\r
 {"class":"AIS","device":"stdin","type":10,"repeat":0,"mmsi":440882000,"scaled":false,"dest_mmsi":366972000}\r
 {"class":"AIS","device":"stdin","type":11,"repeat":0,"mmsi":304137000,"scaled":false,"timestamp":"2009-05-22T02:22:40Z","accuracy":true,"lon":-56644610,"lat":17045470,"epfd":1,"epfd_text":"GPS","raim":false,"radio":0}\r