Format JSON payload
This commit is contained in:
@@ -276,10 +276,9 @@ char* gps_to_json(char* gps_data) {
|
||||
longitude = nmea_to_decimal(fields[4], fields[5][0]);
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(json, sizeof(json), "{\"data\":{\"latitude\":%.6f,\"longitude\":%.6f}}",
|
||||
latitude, longitude);
|
||||
|
||||
|
||||
time_t current_time = time(NULL);
|
||||
snprintf(json, sizeof(json), "{\"latitude\":%.6f,\"longitude\":%.6f}", latitude, longitude);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user