Skip to content

Commit

Permalink
Tweak parsing ais persons as structured data
Browse files Browse the repository at this point in the history
- Type 8, DAC = 1 FID = 16: This should only be decoded as "Persons on board" if the message length is either 72 or 136 bits long (if even then).
- Type 8, DAC = 1 FID = 16: If decoded, the json output should use the ais->type8.dac1fid16.persons field and not the type6 field

TODO: Missing any sample data that exercises this code path - jmls

Identified by: Stefan Roels <sroels-gpsd-dev@42solutions.nl>
  • Loading branch information
yazug committed Oct 6, 2015
1 parent 7a5aa61 commit bc450ee
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions driver_ais.c
Expand Up @@ -528,10 +528,15 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
break;
case 16: /* Number of Persons On Board */
if (ais->type8.bitcount == 136)
ais->type8.dac1fid16.persons = UBITS(88, 13);/* 289 */
else
ais->type8.dac1fid16.persons = UBITS(55, 13);/* 236 */
ais->type8.structured = true;
{
ais->type8.dac1fid16.persons = UBITS(88, 13);/* 289 */
ais->type8.structured = true;
}
else if (ais->type8.bitcount == 72)
{
ais->type8.dac1fid16.persons = UBITS(55, 13);/* 236 */
ais->type8.structured = true;
}
break;
case 17: /* IMO289 - VTS-generated/synthetic targets */
#define ARRAY_BASE 56
Expand Down

0 comments on commit bc450ee

Please sign in to comment.