I'm totally lost with this. Why are the results different from the original? Can I use char instead of float for the dt_time as I would like to parse it into a more readable form?
I get:
date is : 20230526992384.000000
lat: 54.568832
lng: -5.942575
count is : 3
int count;
float dt_time,lat,lng;
char* buffer="+CGNSINF: 1,1,20230526110935.000,54.568834,-5.942575,30.300,0.00,209.5,1,,0.9,1.2,0.8,,13,8,,,33,,";
void setup() {
Serial.begin(115200);
count= sscanf(buffer, "+CGNSINF: 1,1,%f,%f,%f,,0.0", &dt_time,&lat,&lng);
Serial.println();
printf("date is : %f\n",dt_time);
printf("lat: %f\n",lat);
printf("lng: %f\n",lng);
printf("count is : %d\n",count);
}
void loop() {}
