ttlappalainen / NMEA0183

Library for handling NMEA0183 messages
73 stars 47 forks source link

Setting units of measure when creating a GGA message #18

Open floathub opened 3 years ago

floathub commented 3 years ago

This library is superb, and together with NMEA2000 is just such a great contribution.

Unless there is something we are not understanding (which is not uncommon), the NMEA0183SetGGA() method should be setting strings of "M" (for meters) as fields 9 and 11. Currently it seems to generate GGA messages without those units fields for the related altitude and geoseparation fields.

Happy to do a pull request, but just wanted to make sure there is not something obvious we are failing to see.

ttlappalainen commented 3 years ago

It has dropped away on some update. Should be: if ( !NMEA0183Msg.AddDoubleField(Altitude,1,tNMEA0183Msg::DefDoubleFormat,"M") ) return false; if ( !NMEA0183Msg.AddDoubleField(GeoidalSeparation,1,tNMEA0183Msg::DefDoubleFormat,"M") ) return false;

Please test with those.

floathub commented 3 years ago

Ah, very good. We had just added:

if ( !NMEA0183Msg.AddStrField("M") ) return false; if ( !NMEA0183Msg.AddStrField("M") ) return false;

in positions 9 and 11. But your solution is much better.

Looks great here, we are testing, will let you know if anything odd pops up.

ttlappalainen commented 3 years ago

I updated the library with modifications I succested.

floathub commented 3 years ago

Excellent, and thanks.

We continue to test at this end. Everything we've tried is very happy with the GGA it is now producing. Will let you know if we see any issues.