Skip to content

Commit

Permalink
add an ais type9 sample which has speed
Browse files Browse the repository at this point in the history
Type 9: the ais->type9.speed field should be used instead of the type1 field

Identifed by: Stefan Roels <sroels-gpsd-dev@42solutions.nl>
  • Loading branch information
yazug committed Oct 6, 2015
1 parent 8f3e666 commit 7a5aa61
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gpsd_json.c
Expand Up @@ -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,"
Expand Down
19 changes: 19 additions & 0 deletions test/sample.aivdm
Expand Up @@ -483,6 +483,25 @@
# 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
Expand Down
1 change: 1 addition & 0 deletions test/sample.aivdm.chk
Expand Up @@ -21,6 +21,7 @@
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|0xc02a
9|0|111232511|303|42|0|-3767306|34886400|1545|15|0x0|1|0|0x8270
10|0|366814480|366832740
10|0|440882000|366972000
11|0|304137000|2009-05-22T02:22:40Z|1|-56644610|17045470|1|0|0x0
Expand Down
1 change: 1 addition & 0 deletions test/sample.aivdm.js.chk
Expand Up @@ -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}
{"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":49194}
{"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}
{"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}
{"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}
Expand Down
1 change: 1 addition & 0 deletions test/sample.aivdm.ju.chk
Expand Up @@ -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}
{"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":49194}
{"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}
{"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}
{"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}
Expand Down

0 comments on commit 7a5aa61

Please sign in to comment.