mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-08-14 01:54:48 +02:00
Updated Avoiding pitfalls (markdown)
@@ -13,7 +13,7 @@ There are basically two reasons why they may fail:
|
|||||||
|
|
||||||
So, if you are sure the JSON string is correct and you still can't parse it, you should try to increase the size of the `StaticJsonBuffer`.
|
So, if you are sure the JSON string is correct and you still can't parse it, you should try to increase the size of the `StaticJsonBuffer`.
|
||||||
|
|
||||||
You can use the [JsonBuffer size calculator](https://bblanchon.github.io/ArduinoJson/) to compute the required size.
|
You can use the [ArduinoJson Assistant](https://bblanchon.github.io/ArduinoJson/assistant/) to compute the required size.
|
||||||
|
|
||||||
#### 2. Make sure everything fits in memory
|
#### 2. Make sure everything fits in memory
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ For this reason, **you should not use a global variable** for your `JsonBuffer`.
|
|||||||
|
|
||||||
The best practice is to **declare it in a local scope**, so that it's discarded as soon as possible. My advice is to declare it in a function whose unique role is to handle the JSON serialization.
|
The best practice is to **declare it in a local scope**, so that it's discarded as soon as possible. My advice is to declare it in a function whose unique role is to handle the JSON serialization.
|
||||||
|
|
||||||
See [FAQ: The first parsing succeeds, why does the next ones fail?](https://github.com/bblanchon/ArduinoJson/wiki/FAQ#the-first-parsing-succeeds-why-does-the-next-ones-fail)
|
See [FAQ: The first parsing succeeds, why does the next ones fail?](https://bblanchon.github.io/ArduinoJson/faq/the-first-parsing-succeeds-why-does-the-next-ones-fail)
|
||||||
|
|
||||||
#### 5. Keep the JSON string in memory long enough
|
#### 5. Keep the JSON string in memory long enough
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user