diff options
-rw-r--r-- | driver_ais.c | 2 | ||||
-rw-r--r-- | gps.h | 6 | ||||
-rw-r--r-- | gpsd_json.c | 14 | ||||
-rw-r--r-- | jsongen.py.in | 4 | ||||
-rw-r--r-- | test/sample.aivdm | 22 | ||||
-rw-r--r-- | test/sample.aivdm.chk | 1 | ||||
-rw-r--r-- | test/sample.aivdm.js.chk | 1 | ||||
-rw-r--r-- | test/sample.aivdm.ju.chk | 1 | ||||
-rw-r--r-- | www/AIVDM.txt | 7 |
9 files changed, 43 insertions, 15 deletions
diff --git a/driver_ais.c b/driver_ais.c index 0a5b9845..13ba3ccd 100644 --- a/driver_ais.c +++ b/driver_ais.c @@ -668,7 +668,7 @@ bool ais_binary_decode(const int debug, UCHARS(56, ais->type8.dac200fid10.vin); ais->type8.dac200fid10.length = UBITS(104, 13); ais->type8.dac200fid10.beam = UBITS(117, 10); - ais->type8.dac200fid10.type = UBITS(127, 14); + ais->type8.dac200fid10.shiptype = UBITS(127, 14); ais->type8.dac200fid10.hazard = UBITS(141, 3); ais->type8.dac200fid10.draught = UBITS(144, 11); ais->type8.dac200fid10.loaded = UBITS(155, 2); @@ -1250,10 +1250,10 @@ struct ais_t char bitdata[(AIS_TYPE8_BINARY_MAX + 7) / 8]; /* Inland static ship and voyage-related data */ struct { - char vin[8+1]; /* European Vessel ID */ + char vin[8+1]; /* European Vessel ID */ unsigned int length; /* Length of ship */ - unsigned int beam; /* Beam of ship */ - unsigned int type; /* Ship/combination type */ + unsigned int beam; /* Beam of ship */ + unsigned int shiptype; /* Ship/combination type */ unsigned int hazard; /* Hazardous cargo */ unsigned int draught; /* Draught */ unsigned int loaded; /* Loaded/Unloaded */ diff --git a/gpsd_json.c b/gpsd_json.c index 14212fd6..9a069a30 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -2813,22 +2813,22 @@ void json_aivdm_dump(const struct ais_t *ais, switch (ais->type8.fid) { case 10: /* Inland ship static and voyage-related data */ for (cp = shiptypes; cp < shiptypes + NITEMS(shiptypes); cp++) - if (cp->code == ais->type8.dac200fid10.type - || cp->ais == ais->type8.dac200fid10.type) + if (cp->code == ais->type8.dac200fid10.shiptype + || cp->ais == ais->type8.dac200fid10.shiptype) break; (void)snprintf(buf + strlen(buf), buflen - strlen(buf), "\"vin\":\"%s\",\"length\":%u,\"beam\":%u," - "\"type\":%u,\"type_text\":\"%s\"," + "\"shiptype\":%u,\"shiptype_text\":\"%s\"," "\"hazard\":%u,\"hazard_text\":\"%s\"," "\"draught\":%u," "\"loaded\":%u,\"loaded_text\":\"%s\"," - "\"speed_q\":\"%s\"," - "\"course_q\":\"%s\"," - "\"heading_q\":\"%s\"}\r\n", + "\"speed_q\":%s," + "\"course_q\":%s," + "\"heading_q\":%s}\r\n", ais->type8.dac200fid10.vin, ais->type8.dac200fid10.length, ais->type8.dac200fid10.beam, - ais->type8.dac200fid10.type, + ais->type8.dac200fid10.shiptype, cp->legend, ais->type8.dac200fid10.hazard, HTYPE_DISPLAY(ais->type8.dac200fid10.hazard), diff --git a/jsongen.py.in b/jsongen.py.in index 3f14df98..9a500dd4 100644 --- a/jsongen.py.in +++ b/jsongen.py.in @@ -355,8 +355,8 @@ ais_specs = ( ('vin', 'string', None), ('length', 'uinteger', '0'), ('beam', 'uinteger', '0'), - ('type', 'uinteger', '0'), - ('type_text', 'ignore', None), + ('shiptype', 'uinteger', '0'), + ('shiptype_text', 'ignore', None), ('hazard', 'uinteger', '0'), ('hazard_text','ignore', None), ('draught', 'uinteger', '0'), diff --git a/test/sample.aivdm b/test/sample.aivdm index f82582b9..5a93d9ba 100644 --- a/test/sample.aivdm +++ b/test/sample.aivdm @@ -428,6 +428,28 @@ # Salinity=0x1FE(51.0 permil) # Ice=0x3(3) # +# Type 8, DAC 200, FID 10 (Inland AIS Ship Static and Voyage Data) +# Paul Courbis <paul@courbis.com> +!AIVDM,1,1,,B,83aDChPj2d<dL<uM=hhhI?a@6HP0,0*40 +# Message type : 8 +# Repleat Indicator : 0 +# MMSI : 244650946 +# DAC : 200 +# FID : 10 +# VIN : 02103547 +# Length : 390 +# Beam : 50 +# Vessel type : 8010 +# Type 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 +# # 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 28f11a62..2df3d918 100644 --- a/test/sample.aivdm.chk +++ b/test/sample.aivdm.chk @@ -18,6 +18,7 @@ 8|0|992509977|1|11|-368039|3197693|18T17:15Z|3|6|12|15|742|50|323|224|2|153|16|1|103|256|104|257|10|126|203|20|42|35|25|23|48|124|3|223|6|53|0
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
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 51abd2ed..df238041 100644 --- a/test/sample.aivdm.js.chk +++ b/test/sample.aivdm.js.chk @@ -18,6 +18,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:15Z","wspeed":3,"wgust":6,"wdir":12,"wgustdir":15,"humidity":50,"airtemp":14.2,"dewpoint":12.3,"pressure":1024,"pressuretend":"decreasing","visibility":15.3,"waterlevel":-8.4,"leveltrend":"increasing","cspeed":10.3,"cdir":256,"cspeed2":10.4,"cdir2":257,"cdepth2":10,"cspeed3":12.6,"cdir3":203,"cdepth3":20,"waveheight":4.2,"waveperiod":35,"wavedir":25,"swellheight":2.3,"swellperiod":48,"swelldir":124,"seastate":3,"watertemp":12.3,"preciptype":6,"preciptype_text":"reserved","salinity":5.3,"ice":0,"ice_text":"no"}
{"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":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 a7bbdba9..110bbabd 100644 --- a/test/sample.aivdm.ju.chk +++ b/test/sample.aivdm.ju.chk @@ -18,6 +18,7 @@ {"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992509977,"scaled":false,"dac":1,"fid":11,"lat":3197693,"lon":-368039,"timestamp":"18T17:15Z","wspeed":3,"wgust":6,"wdir":12,"wgustdir":15,"humidity":50,"airtemp":742,"dewpoint":323,"pressure":224,"pressuretend":2,"visibility":153,"waterlevel":16,"leveltrend":1,"cspeed":103,"cdir":256,"cspeed2":104,"cdir2":257,"cdepth2":10,"cspeed3":126,"cdir3":203,"cdepth3":20,"waveheight":42,"waveperiod":35,"wavedir":25,"swellheight":23,"swellperiod":48,"swelldir":124,"seastate":3,"watertemp":223,"preciptype":6,"preciptype_text":"reserved","salinity":53,"ice":0,"ice_text":"no"}
{"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":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}
diff --git a/www/AIVDM.txt b/www/AIVDM.txt index 54b4b046..b54def33 100644 --- a/www/AIVDM.txt +++ b/www/AIVDM.txt @@ -1,6 +1,6 @@ = AIVDM/AIVDO protocol decoding = Eric S. Raymond <esr@thyrsus.com> -v1.45, May 2014 +v1.46, Aug 2014 This document is mastered in asciidoc format. If you are reading it in HTML, you can find the original at the GPSD project website @@ -3585,7 +3585,7 @@ message 5. |56-103 | 48 |European Vessel ID |vin |t|8 six-bit characters |104-116 | 13 |Length of ship |length |u|1-8000 * 0.1m, default 0 |117-126 | 10 |Beam of ship |beam |u|1-1000 * 0.1m, default 0 -|127-140 | 14 |Ship/combination type |type |e|ERI Classification +|127-140 | 14 |Ship/combination type |shiptype |e|ERI Classification |141-143 | 3 |Hazardous cargo |hazard |e|See "Hazard Codes" below |144-154 | 11 |Draught |draught |u|1-200 * 0.01m, default 0 |155-156 | 2 |Loaded/Unloaded |loaded |e|See "Load Status" below @@ -5363,3 +5363,6 @@ the <<MMSI link>>, which was stale. Version 1.45 adds a description of variant AIS talker IDs and NMEA 4.00 tag blocks. + +Version 1.46 corrects an error in the specification on Inland AIS Type +10s. |