ttlappalainen / NMEA0183

Library for handling NMEA0183 messages
69 stars 44 forks source link

Use library to only parse sentence #43

Open hugorobi opened 1 year ago

hugorobi commented 1 year ago

Hi everyone,

First, sorry if it's not the right place to ask !

I used this library and example to make a NMEA0183 Wifi gateway. This works perfectly as I can have values on Navionics App.

Now, I'm bulding an Android App to have personalized screen with data.

I already have sentences readed succesfully on device.

My question:

Is there a way to use this library to only parse sentences ?

ttlappalainen commented 1 year ago

If you have message in char *buf Construct NMEA0183 message and parse it tNMEA0183Msg NMEA0183Msg;

if ( NMEA0183Msg.SetMessage(buf) ) { // Here you need to select parser according message. // You can e.g., make arrays of message codes/parser functions or simply use if for testing if ( strcmp(NMEA0183Msg.IsMessageCode("GGA") ) { NMEA0183ParseGGA_nc(NMEA0183Msg,...); } else ... }