Christian Gagneraud<address@hidden>:
Interpreting the AIS structures requires already lot of
foreknowledge, there's plenty of enum values and magic constant
(data not available).
Enums are not part of the API, but the NOT_AVAILABLE are (def'ed in gps.h).
What about moving these 6 offset constants in gps.h beside their
XXX_NOT_AVAILABLE? (FID31 needs only 1 constant not 5. I have one
commit here for FID31 fixes). And while we are here, why not adding
the scaling factors as well? This way, clients will have all the
information to go from raw to interpreted data.
Another consequence of doing the offset in the driver is that the
gpsd' version of the NOT_AVAILABLE values are different from the IMO
standards (and from the ones documented in AIVDM.txt)
Hm. Your last paragraph makes a good point - that is confusing.
I guess you're right and all the scaling ought to be done in one place,
with the scaling constants visible in gps.h.