Closed navinyate closed 6 years ago
const size_t bufferSize = 2*JSON_OBJECT_SIZE(2) + 60;
DynamicJsonBuffer jsonBuffer(bufferSize);
const char* json = "{\"location\":{\"lat\":12.534121,\"lng\":76.9126},\"accuracy\":550}";
JsonObject& root = jsonBuffer.parseObject(json);
float location_lat = root["location"]["lat"]; // 12.534121
float location_lng = root["location"]["lng"]; // 76.9126
int accuracy = root["accuracy"]; // 550
@bblanchon love it
Am using Neoway N10 GPRS module, where I using the location of a device.
The Sentence is +CIPGSMLOC: {"location":{"lat":12.534121,"lng":76.9126},"accuracy":550.0}
Am trying to get lat and lon and use this as variable.
Please help me.