Updated FAQ (markdown)

Benoît Blanchon
2015-11-08 09:51:40 +01:00
parent 661d21ca31
commit 125cd2dbdc

23
FAQ.md

@@ -14,6 +14,29 @@ If you're is case 2., you can solve the problem by increasing the size of the `S
If you're in case 3., you may have a memory leak, it up to you to find it. You can try to switch to `StaticJsonBuffer` which is more efficient.
### The first parsing succeeds, why the next ones fail?
This can be due to two causes.
##### Cause 1: reuse of `JsonBuffer`
First, this can happen if you reuse the same `JsonBuffer`, for example:
```c++
StaticJsonBuffer<200> jsonBuffer;
for (int i=0; i<10; i++) {
char json[256];
readJsonFromSomewhere(json, sizeof(json));
JsonObject& root = jsonBuffer.parse(json);
if (root.success()) {
Serial.println("parseObject() succeeded");
} else {
Serial.println("parseObject() failed!");
}
}
```
### What are the differences between `StaticJsonBuffer` and `DynamicJsonBuffer`?
| `StaticJsonBuffer` | `DynamicJsonBuffer`