We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include <ArduinoJson.h> void setup() { Serial.begin(9600); delay(2000); StaticJsonBuffer<200> jsonBuffer; char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[{\"a\":48.756080,\"b\":2.302038}]}"; JsonObject& root = jsonBuffer.parseObject(json); if (!root.success()) { Serial.println("parseObject() failed"); return; } const char* sensor = root["sensor"]; long time = root["time"]; JsonArray& array = root["data"]; Serial.println(sensor); Serial.println(time); Serial.println(array.size()); } void loop() { // not used in this example }
array.size() is 0. It seems parse fail,but no error occur.
The text was updated successfully, but these errors were encountered:
maybe the size 200 for StaticJsonBuffer is too small. The size up to 2000 is OK!
Sorry, something went wrong.
No branches or pull requests
array.size() is 0.
It seems parse fail,but no error occur.
The text was updated successfully, but these errors were encountered: