Fri 18 Oct 2013 06:30:54 AM UTC, original submission:
In driver_ais.c, type 19 messages have a few decoding bugs:
ais->type19.epfd = UBITS(299, 4);
ais->type19.raim = UBITS(302, 1)!=0;
ais->type19.dte = UBITS(305, 1)!=0;
ais->type19.assigned = UBITS(306, 1)!=0;
The correct code should be:
ais->type19.epfd = UBITS(301, 4);
ais->type19.raim = UBITS(305, 1)!=0;
ais->type19.dte = UBITS(306, 1)!=0;
ais->type19.assigned = UBITS(307, 1)!=0;
Here's a test string I pulled off an online data source:
!AIVDM,1,1,,B,C69>7mh0>r<9vD5Auh;PcwVPHc0TNL?0jc1WQkR00000?1@5222P,0*52
The above message should yield the following fields:
to_port: 4,
to_stern: 10,
course: 359.4,
to_starboard: 4,
speed: 5.9,
raim: false,
epfd: 1,
to_bow: 20,
dte: 1,
repeat: false,
assigned: false,
accuracy: true,
lon: 122.47004,
regional: 0,
lat: 36.91477666666667,
second: 13,
shipname: "LU RONG YU 3091",
shiptype: 30,
mmsi: 412321751
|