Fix json_aivdm_dump for bad temp scaling
authorJon Schlueter <jschlueter@redhat.com>
Tue, 6 Oct 2015 07:13:49 +0000 (03:13 -0400)
committerJon Schlueter <jschlueter@redhat.com>
Tue, 6 Oct 2015 07:17:40 +0000 (03:17 -0400)
- Type 8, DAC = 1 FID = 11: airtemp, dewpoint and watertemp calculations go wrong due to unsigned ints.

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

unsigned/signed subtraction was causing math to go wonky.
new sample data added to sample.aivdm which exibits the conversion errors

Also identified watertemp that was failing from same data

Regenerated the corresponding check files from current code

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

index 9ccad3d..530ee3d 100644 (file)
@@ -2167,8 +2167,8 @@ void json_aivdm_dump(const struct ais_t *ais,
                    str_appendf(buf, buflen,
                                   "\"airtemp\":%.1f,\"dewpoint\":%.1f,"
                                   "\"pressure\":%u,\"pressuretend\":\"%s\",",
-                                  (ais->type8.dac1fid11.airtemp - DAC1FID11_AIRTEMP_OFFSET) / DAC1FID11_AIRTEMP_DIV,
-                                  (ais->type8.dac1fid11.dewpoint - DAC1FID11_DEWPOINT_OFFSET) / DAC1FID11_DEWPOINT_DIV,
+                                  ((signed int)ais->type8.dac1fid11.airtemp - DAC1FID11_AIRTEMP_OFFSET) / DAC1FID11_AIRTEMP_DIV,
+                                  ((signed int)ais->type8.dac1fid11.dewpoint - DAC1FID11_DEWPOINT_OFFSET) / DAC1FID11_DEWPOINT_DIV,
                                   ais->type8.dac1fid11.pressure - DAC1FID11_PRESSURE_OFFSET,
                                   trends[ais->type8.dac1fid11.pressuretend]);
                else
@@ -2195,7 +2195,7 @@ void json_aivdm_dump(const struct ais_t *ais,
                else
                    str_appendf(buf, buflen,
                                   "\"waterlevel\":%.1f,",
-                                  (ais->type8.dac1fid11.waterlevel - DAC1FID11_WATERLEVEL_OFFSET) / DAC1FID11_WATERLEVEL_DIV);
+                                  ((signed int)ais->type8.dac1fid11.waterlevel - DAC1FID11_WATERLEVEL_OFFSET) / DAC1FID11_WATERLEVEL_DIV);
 
                if (scaled) {
                    str_appendf(buf, buflen,
@@ -2224,7 +2224,7 @@ void json_aivdm_dump(const struct ais_t *ais,
                                   ais->type8.dac1fid11.swellperiod,
                                   ais->type8.dac1fid11.swelldir,
                                   ais->type8.dac1fid11.seastate,
-                                  (ais->type8.dac1fid11.watertemp - DAC1FID11_WATERTEMP_OFFSET) / DAC1FID11_WATERTEMP_DIV,
+                                  ((signed int)ais->type8.dac1fid11.watertemp - DAC1FID11_WATERTEMP_OFFSET) / DAC1FID11_WATERTEMP_DIV,
                                   ais->type8.dac1fid11.preciptype,
                                   preciptypes[ais->type8.dac1fid11.preciptype],
                                   ais->type8.dac1fid11.salinity / DAC1FID11_SALINITY_DIV,
@@ -2483,7 +2483,7 @@ void json_aivdm_dump(const struct ais_t *ais,
                else
                    str_appendf(buf, buflen,
                                   "\"waterlevel\":%.1f,",
-                                  (ais->type8.dac1fid31.waterlevel - DAC1FID31_WATERLEVEL_OFFSET) / DAC1FID31_WATERLEVEL_DIV);
+                                  ((unsigned int)ais->type8.dac1fid31.waterlevel - DAC1FID31_WATERLEVEL_OFFSET) / DAC1FID31_WATERLEVEL_DIV);
 
                if (scaled) {
                    str_appendf(buf, buflen,
index 8321f73..61e000f 100644 (file)
@@ -1035,3 +1035,24 @@ AIVDM,2,2,1,B,00000000000,2*26
 # Array of struct, used to crash "gpsdecode -j -e -u"
 !AIVDM,1,1,,A,6h2E3MHrg19P0600@00000000000,0*02
 !AIVDM,1,1,,A,6h2E3N0rThqP0600J00000000000,0*51
+# Temp conversion with unsigned failed
+!AIVDM,1,1,,A,8@2<HW@0BkdhF0dcH59=RiRRDqnJ7wfRwwwwwwwwwwwwwwwwwwwwwwwwwt0,2*7D
+# {"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300061,"scaled":true,"dac":1,"fid":11,"lat":64.650,"lon":24.400,"timestamp":"20T18:27Z","wspeed":11,"wgust":12,"wdir":162,"wgustdir":167,"humidity":80,"airtemp":-12.7,"dewpoint":82.3,"pressure":1032,"pressuretend":"decreasing","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"}
+# more samples from Stefan
+!AIVDM,2,1,2,B,8@2<HV@0BkM5OPiGTU9=TRiS<J>G7wfNwwww,0*32
+!AIVDM,2,2,2,B,wwwwwwwwwwwwwwwwwwwwwt0,2*26
+#{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300057,"scaled":true,"dac":1,"fid":11,"lat":60.371,"lon":26.962,"timestamp":"20T18:27Z","wspeed":18,"wgust":22,"wdir":99,"wgustdir":99,"humidity":56,"airtemp":-3.1,"dewpoint":82.3,"pressure":1031,"pressuretend":"decreasing","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"}
+!AIVDM,2,1,9,B,8>j`;MP0GhRHI1S`CrTW2?u2Ot1owwnews0F003wwwwwww0001wwwwwwwwh0,0*02
+!AIVDM,2,2,9,B,00,4*18
+#{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992611190,"scaled":true,"dac":1,"fid":31,"lat":54.411,"lon":18.777,"accuracy":false,"timestamp":"20T18:28Z","wspeed":17,"wgust":127,"wdir":132,"wgustdir":511,"humidity":127,"airtemp":1.4,"dewpoint":-0.1,"pressure":1013,"pressuretend":"N/A","visgreater":true,"visibility":12.7,"waterlevel":5.4,"leveltrend":"N/A","cspeed":0.0,"cdir":0,"cspeed2":25.5,"cdir2":511,"cdepth2":31,"cspeed3":25.5,"cdir3":511,"cdepth3":31,"waveheight":0.0,"waveperiod":0,"wavedir":0,"swellheight":25.5,"swellperiod":63,"swelldir":511,"seastate":15,"watertemp":-0.1,"preciptype":"N/A","salinity":51.1,"ice":"N/A"}
+!AIVDM,1,1,,A,8@2<HVh0BkL8V@Wfp=9=RAA57jC;wwf>wwwwwwwwwwwwwwwwwwwwwwwwwt0,2*0E
+#{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300059,"scaled":true,"dac":1,"fid":11,"lat":60.111,"lon":21.699,"timestamp":"20T18:27Z","wspeed":9,"wgust":10,"wdir":69,"wgustdir":62,"humidity":95,"airtemp":-1.2,"dewpoint":82.3,"pressure":1027,"pressuretend":"decreasing","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"}
+!AIVDM,1,1,,A,8@2<HW@0Bkb<B0akj59>1@juFB4:7wfNwwwwwwwwwwwwwwwwwwwwwwwwwt0,2*55
+#{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300061,"scaled":true,"dac":1,"fid":11,"lat":63.950,"lon":22.833,"timestamp":"20T18:28Z","wspeed":5,"wgust":6,"wdir":189,"wgustdir":178,"humidity":80,"airtemp":-7.2,"dewpoint":82.3,"pressure":1031,"pressuretend":"decreasing","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"}
+!AIVDM,1,1,,A,8@2<HV@0BkLfrhhJWM9=SjAk=B@pOwfNwwwwwwwwwwwwwwwwwwwwwwwwwt0,2*66
+#{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300057,"scaled":true,"dac":1,"fid":11,"lat":60.275,"lon":26.442,"timestamp":"20T18:27Z","wspeed":15,"wgust":18,"wdir":115,"wgustdir":106,"humidity":67,"airtemp":-2.1,"dewpoint":82.3,"pressure":1031,"pressuretend":"decreasing","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"}
+!AIVDM,1,1,,A,8@2<HVh0BkM75P`MKU9>31iL:RBcGwfBwwwwwwwwwwwwwwwwwwwwwwwwwt0,2*5F
+#{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300059,"scaled":true,"dac":1,"fid":11,"lat":60.378,"lon":22.096,"timestamp":"20T18:28Z","wspeed":12,"wgust":14,"wdir":92,"wgustdir":84,"humidity":90,"airtemp":-1.4,"dewpoint":82.3,"pressure":1028,"pressuretend":"decreasing","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"}
+!AIVDM,2,1,7,B,802`m000BkGTp0b<j59?000000000000000O,0*14
+!AIVDM,2,2,7,B,p0000000000<0000000@000,2*1C
+#{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":2766080,"scaled":true,"dac":1,"fid":11,"lat":58.867,"lon":23.047,"timestamp":"20T18:30Z","wspeed":0,"wgust":0,"wdir":0,"wgustdir":0,"humidity":0,"airtemp":-60.0,"dewpoint":-20.0,"pressure":800,"pressuretend":"steady","visibility":0.0,"waterlevel":-10.0,"leveltrend":"steady","cspeed":25.5,"cdir":0,"cspeed2":0.0,"cdir2":0,"cdepth2":0,"cspeed3":0.0,"cdir3":0,"cdepth3":0,"waveheight":0.0,"waveperiod":3,"wavedir":0,"swellheight":0.0,"swellperiod":0,"swelldir":0,"seastate":0,"watertemp":429496729.6,"preciptype":0,"preciptype_text":"reserved","salinity":0.0,"ice":0,"ice_text":"no"}
index b8c188b..701dc76 100644 (file)
 6|0|002444012|0|255803540|1|1|18|80:01000000000000000000\r
 6|3|002442101|2|246351000|0|1|32|80:00000000000000000100\r
 6|3|002442104|0|245679000|0|1|32|80:00000000000000000100\r
+8|1|002300061|1|11|1464000|3879000|20T18:27Z|11|12|162|167|473|80|1023|232|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3\r
+8|1|002300057|1|11|1617700|3622270|20T18:27Z|18|22|99|99|569|56|1023|231|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3\r
+8|0|992611190|1|31|1126600|3264671|20T18:28Z|17|127|132|511|14|127|-1|214|3|127|1538|3|0|0|255|511|31|255|511|31|0|0|0|255|63|511|15|-1|7|511|3\r
+8|1|002300059|1|11|1301953|3606681|20T18:27Z|9|10|69|62|588|95|1023|227|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3\r
+8|1|002300061|1|11|1370000|3837000|20T18:28Z|5|6|189|178|528|80|1023|231|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3\r
+8|1|002300057|1|11|1586491|3616491|20T18:27Z|15|18|115|106|579|67|1023|231|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3\r
+8|1|002300059|1|11|1325788|3622678|20T18:28Z|12|14|92|84|586|90|1023|228|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3\r
+8|0|002766080|1|11|1382800|3532000|20T18:30Z|0|0|0|0|0|0|0|0|0|0|0|0|255|0|0|0|0|0|0|0|0|3|0|0|0|0|0|1|0|0|0\r
index 8671140..f936d52 100644 (file)
 {"class":"AIS","device":"stdin","type":6,"repeat":0,"mmsi":2444012,"scaled":true,"seqno":0,"dest_mmsi":255803540,"retransmit":true,"dac":1,"fid":18,"linkage":1,"arrival":"00-00T00:00Z","portname":"","destination":"","lon":0.000,"lat":0.000}\r
 {"class":"AIS","device":"stdin","type":6,"repeat":3,"mmsi":2442101,"scaled":true,"seqno":2,"dest_mmsi":246351000,"retransmit":false,"dac":1,"fid":32,"month":0,"day":0,"tidals":[{"lon":-279.620,"lat":0.000,"from_hour":0,"from_min":0,"to_hour":0,"to_min":0,"cdir":0,"cspeed":0.0}]}\r
 {"class":"AIS","device":"stdin","type":6,"repeat":3,"mmsi":2442104,"scaled":true,"seqno":0,"dest_mmsi":245679000,"retransmit":false,"dac":1,"fid":32,"month":0,"day":0,"tidals":[{"lon":-104.858,"lat":0.000,"from_hour":0,"from_min":0,"to_hour":0,"to_min":0,"cdir":0,"cspeed":0.0}]}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300061,"scaled":true,"dac":1,"fid":11,"lat":64.650,"lon":24.400,"timestamp":"20T18:27Z","wspeed":11,"wgust":12,"wdir":162,"wgustdir":167,"humidity":80,"airtemp":-12.7,"dewpoint":82.3,"pressure":1032,"pressuretend":"decreasing","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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300057,"scaled":true,"dac":1,"fid":11,"lat":60.371,"lon":26.962,"timestamp":"20T18:27Z","wspeed":18,"wgust":22,"wdir":99,"wgustdir":99,"humidity":56,"airtemp":-3.1,"dewpoint":82.3,"pressure":1031,"pressuretend":"decreasing","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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992611190,"scaled":true,"dac":1,"fid":31,"lat":54.411,"lon":18.777,"accuracy":false,"timestamp":"20T18:28Z","wspeed":17,"wgust":127,"wdir":132,"wgustdir":511,"humidity":127,"airtemp":1.4,"dewpoint":-0.1,"pressure":1013,"pressuretend":"N/A","visgreater":true,"visibility":12.7,"waterlevel":5.4,"leveltrend":"N/A","cspeed":0.0,"cdir":0,"cspeed2":25.5,"cdir2":511,"cdepth2":31,"cspeed3":25.5,"cdir3":511,"cdepth3":31,"waveheight":0.0,"waveperiod":0,"wavedir":0,"swellheight":25.5,"swellperiod":63,"swelldir":511,"seastate":15,"watertemp":-0.1,"preciptype":"N/A","salinity":51.1,"ice":"N/A"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300059,"scaled":true,"dac":1,"fid":11,"lat":60.111,"lon":21.699,"timestamp":"20T18:27Z","wspeed":9,"wgust":10,"wdir":69,"wgustdir":62,"humidity":95,"airtemp":-1.2,"dewpoint":82.3,"pressure":1027,"pressuretend":"decreasing","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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300061,"scaled":true,"dac":1,"fid":11,"lat":63.950,"lon":22.833,"timestamp":"20T18:28Z","wspeed":5,"wgust":6,"wdir":189,"wgustdir":178,"humidity":80,"airtemp":-7.2,"dewpoint":82.3,"pressure":1031,"pressuretend":"decreasing","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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300057,"scaled":true,"dac":1,"fid":11,"lat":60.275,"lon":26.442,"timestamp":"20T18:27Z","wspeed":15,"wgust":18,"wdir":115,"wgustdir":106,"humidity":67,"airtemp":-2.1,"dewpoint":82.3,"pressure":1031,"pressuretend":"decreasing","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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300059,"scaled":true,"dac":1,"fid":11,"lat":60.378,"lon":22.096,"timestamp":"20T18:28Z","wspeed":12,"wgust":14,"wdir":92,"wgustdir":84,"humidity":90,"airtemp":-1.4,"dewpoint":82.3,"pressure":1028,"pressuretend":"decreasing","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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":2766080,"scaled":true,"dac":1,"fid":11,"lat":58.867,"lon":23.047,"timestamp":"20T18:30Z","wspeed":0,"wgust":0,"wdir":0,"wgustdir":0,"humidity":0,"airtemp":-60.0,"dewpoint":-20.0,"pressure":800,"pressuretend":"steady","visibility":0.0,"waterlevel":-10.0,"leveltrend":"steady","cspeed":25.5,"cdir":0,"cspeed2":0.0,"cdir2":0,"cdepth2":0,"cspeed3":0.0,"cdir3":0,"cdepth3":0,"waveheight":0.0,"waveperiod":3,"wavedir":0,"swellheight":0.0,"swellperiod":0,"swelldir":0,"seastate":0,"watertemp":-9.9,"preciptype":0,"preciptype_text":"reserved","salinity":0.0,"ice":0,"ice_text":"no"}\r
index 2e77635..d5c6fa9 100644 (file)
 {"class":"AIS","device":"stdin","type":6,"repeat":0,"mmsi":2444012,"scaled":false,"seqno":0,"dest_mmsi":255803540,"retransmit":true,"dac":1,"fid":18,"linkage":1,"arrival":"00-00T00:00Z","portname":"","destination":"","lon":0,"lat":0}\r
 {"class":"AIS","device":"stdin","type":6,"repeat":3,"mmsi":2442101,"scaled":false,"seqno":2,"dest_mmsi":246351000,"retransmit":false,"dac":1,"fid":32,"month":0,"day":0,"tidals":[{"lon":-16777216,"lat":0,"from_hour":0,"from_min":0,"to_hour":0,"to_min":0,"cdir":0,"cspeed":0}]}\r
 {"class":"AIS","device":"stdin","type":6,"repeat":3,"mmsi":2442104,"scaled":false,"seqno":0,"dest_mmsi":245679000,"retransmit":false,"dac":1,"fid":32,"month":0,"day":0,"tidals":[{"lon":-6291456,"lat":0,"from_hour":0,"from_min":0,"to_hour":0,"to_min":0,"cdir":0,"cspeed":0}]}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300061,"scaled":false,"dac":1,"fid":11,"lat":3879000,"lon":1464000,"timestamp":"20T18:27Z","wspeed":11,"wgust":12,"wdir":162,"wgustdir":167,"humidity":80,"airtemp":473,"dewpoint":1023,"pressure":232,"pressuretend":2,"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"} \r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300057,"scaled":false,"dac":1,"fid":11,"lat":3622270,"lon":1617700,"timestamp":"20T18:27Z","wspeed":18,"wgust":22,"wdir":99,"wgustdir":99,"humidity":56,"airtemp":569,"dewpoint":1023,"pressure":231,"pressuretend":2,"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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":992611190,"scaled":false,"dac":1,"fid":31,"lat":3264671,"lon":1126600,"accuracy":false,"timestamp":"20T18:28Z","wspeed":17,"wgust":127,"wdir":132,"wgustdir":511,"humidity":127,"airtemp":14,"dewpoint":-1,"pressure":214,"pressuretend":3,"visgreater":true,"visibility":127,"waterlevel":1538,"leveltrend":3,"cspeed":0,"cdir":0,"cspeed2":255,"cdir2":511,"cdepth2":31,"cspeed3":255,"cdir3":511,"cdepth3":31,"waveheight":0,"waveperiod":0,"wavedir":0,"swellheight":255,"swellperiod":63,"swelldir":511,"seastate":15,"watertemp":-1,"preciptype":7,"salinity":511,"ice":3}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300059,"scaled":false,"dac":1,"fid":11,"lat":3606681,"lon":1301953,"timestamp":"20T18:27Z","wspeed":9,"wgust":10,"wdir":69,"wgustdir":62,"humidity":95,"airtemp":588,"dewpoint":1023,"pressure":227,"pressuretend":2,"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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300061,"scaled":false,"dac":1,"fid":11,"lat":3837000,"lon":1370000,"timestamp":"20T18:28Z","wspeed":5,"wgust":6,"wdir":189,"wgustdir":178,"humidity":80,"airtemp":528,"dewpoint":1023,"pressure":231,"pressuretend":2,"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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300057,"scaled":false,"dac":1,"fid":11,"lat":3616491,"lon":1586491,"timestamp":"20T18:27Z","wspeed":15,"wgust":18,"wdir":115,"wgustdir":106,"humidity":67,"airtemp":579,"dewpoint":1023,"pressure":231,"pressuretend":2,"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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":1,"mmsi":2300059,"scaled":false,"dac":1,"fid":11,"lat":3622678,"lon":1325788,"timestamp":"20T18:28Z","wspeed":12,"wgust":14,"wdir":92,"wgustdir":84,"humidity":90,"airtemp":586,"dewpoint":1023,"pressure":228,"pressuretend":2,"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"}\r
+{"class":"AIS","device":"stdin","type":8,"repeat":0,"mmsi":2766080,"scaled":false,"dac":1,"fid":11,"lat":3532000,"lon":1382800,"timestamp":"20T18:30Z","wspeed":0,"wgust":0,"wdir":0,"wgustdir":0,"humidity":0,"airtemp":0,"dewpoint":0,"pressure":0,"pressuretend":0,"visibility":0,"waterlevel":0,"leveltrend":0,"cspeed":255,"cdir":0,"cspeed2":0,"cdir2":0,"cdepth2":0,"cspeed3":0,"cdir3":0,"cdepth3":0,"waveheight":0,"waveperiod":3,"wavedir":0,"swellheight":0,"swellperiod":0,"swelldir":0,"seastate":0,"watertemp":1,"preciptype":0,"preciptype_text":"reserved","salinity":0,"ice":0,"ice_text":"no"}\r