ttlappalainen / NMEA0183

Library for handling NMEA0183 messages
76 stars 48 forks source link

Add APB message #38

Closed tonswieb closed 2 years ago

tonswieb commented 2 years ago

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

ttlappalainen commented 2 years 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.