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…
bool gnsinf_cb(void *cb_arg, bool ok, struct mg_str data)
{
LOG(LL_INFO, ("What is ok %d", ok));
sscanf(data.p, "$GPGGA,%f,%f,%c,%f,%c,%f,%f,%d,%f,%f",
&time, &lat, &ns, &lon, &ew, &hdop, &alt, &fix, &course, &speed);
Any comment on this will be helpful, Thank you…