You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -66,7 +66,7 @@ To extract data from the JSON string, you need to create a `JsonParser`, and spe
66
66
> #### How to choose the number of tokens ?
67
67
68
68
> A token is an element of the JSON object: either a key, a value, an hash-table or an array.
69
-
> As an example the `char* json` on the top of this page contains 12 tokens (don't forget to count 1 for the whole object and 1 more for the array itself).
69
+
> As an example the `char json[]` on the top of this page contains 12 tokens (don't forget to count 1 for the whole object and 1 more for the array itself).
70
70
71
71
> The more tokens you allocate, the more complex the JSON can be, but also the more memory is occupied.
72
72
> Each token takes 8 bytes, so `sizeof(JsonParser<32>)` is 256 bytes which is quite big in an Arduino with only 2KB of RAM.
@@ -85,7 +85,7 @@ If you need other type, you can get the string value and parse it yourself.
85
85
86
86
#### Hash-table
87
87
88
-
Consider we have a `char* json` pointing to the following JSON string:
88
+
Consider we have a `char json[]` containing to the following JSON string:
89
89
90
90
{
91
91
"Name":"Blanchon",
@@ -120,7 +120,7 @@ And then extract the member you need:
120
120
121
121
#### Array
122
122
123
-
Consider we have a `char* json` pointing to the following JSON string:
123
+
Consider we have a `char json[]` containing to the following JSON string:
124
124
125
125
[
126
126
[ 1.2, 3.4 ],
@@ -196,7 +196,7 @@ because the local variable `parser` will be *removed* from memory when the funct
196
196
197
197
This will probably never be an issue, but you need to be aware of this feature.
198
198
199
-
When you pass a `char*` to `JsonParser::parseArray()` or `JsonParser::parseHashTable()`, the content of the string will be altered to add `\0` at the end of the tokens.
199
+
When you pass a `char[]` to `JsonParser::parseArray()` or `JsonParser::parseHashTable()`, the content of the string will be altered to add `\0` at the end of the tokens.
200
200
201
201
This is because we want functions like `JsonArray::getString()` to return a null-terminating string without any memory allocation.
0 commit comments