If you are asking a question, please follow this template:
My goal is: I want lattitude, Longitude, time etc from nmea string GPGGA string.
My actions are:I set the gps nmea sentance to give only $GPGGA , but when I compare the data.p with sscanf function. I get nothing at variables.
//sscanf(data.p, “$GPGGA,%f,%f,%c,%f,%c,%f,%f,%d,%f,%f”,
// &time, &lat, &ns, &lon, &ew, &hdop, &alt, &fix, &course, &speed);
when I tried to log ( data.p ) directly .
I can see Disturbed output on console . I can see GPGGA over there too. but there are some charaters from previous cmds and iterations.Same like garbage. but with visible GPGGA.
How can I compare only GPGGA from this disturbed string in data.p?
This is fuction getting called after sequence of command…
I am here using Gps only, so GPGGA is valid sentence, major issue is to read uart string from data.p, Its more of a garbage mixed with recent GPGGA values.
You need to insure that the string you pass to gnsinf_cb is a valid GGA sentence, i.e. it starts with $GPGGA, ends with <CR><LF>, contains 14 comma separated fields and the CRC is ok.