ttlappalainen / NMEA0183

Library for handling NMEA0183 messages
69 stars 44 forks source link

Add APB message #38

Closed tonswieb closed 1 year ago

tonswieb commented 1 year ago

Hi @ttlappalainen , Could you add the APB message to your library. Thanks.

ttlappalainen commented 1 year ago

You could use NMEA0183GetDouble to read double values. It set value to NA, if value does not exist. E.g., APB.xte=NMEA0183GetDouble(NMEA0183Msg.Field(2)); APB.btw=NMEA0183GetDouble(NMEA0183Msg.Field(10),degToRad);

In generally sorting structure saves some memory. Now you have: char, char, double, char, char, double,... Due to aligning structure will eat space: char, char, (6 byte align), double, char, char, (6 byte align), double. By sorting all doubles first saves aligning bytes.