1
- A malloc-free JSON parser for Arduino
2
- =====================================
3
-
1
+ An efficient JSON parser for Arduino
2
+ ====================================
4
3
5
4
This library is an thin C++ wrapper around the * jsmn* tokenizer: http://zserge.com/jsmn.html
6
5
@@ -10,7 +9,7 @@ It has been written with Arduino in mind, but it isn't linked to Arduino librari
10
9
11
10
12
11
Features
13
- -------
12
+ --------
14
13
15
14
* Based on the well-proven [ jsmn] ( http://zserge.com/jsmn.html ) tokenizer
16
15
* Supports nested objects
@@ -43,7 +42,6 @@ Example
43
42
44
43
45
44
46
-
47
45
How to use ?
48
46
-------------
49
47
@@ -74,7 +72,7 @@ To extract data from the JSON string, you need to create a `JsonParser`, and spe
74
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.
75
73
> Don't forget that you also have to store the JSON string in RAM and it's probably big.
76
74
77
- > 32 tokens may seem small but it's very descent for an 8-bit processor, you wouldn't get better results with other JSON libraries.
75
+ > 32 tokens may seem small, but it's very decent for an 8-bit processor, you wouldn't get better results with other JSON libraries.
78
76
79
77
### 4. Extract data
80
78
@@ -150,7 +148,6 @@ or simply:
150
148
double a = root.getArray(0).getDouble(0);
151
149
152
150
153
-
154
151
Common pitfalls
155
152
---------------
156
153
@@ -204,8 +201,6 @@ When you pass a `char*` to `JsonParser::parseArray()` or `JsonParser::
B838
parseHashT
204
201
This is because we want functions like ` JsonArray::getString() ` to return a null-terminating string without any memory allocation.
205
202
206
203
207
-
208
-
209
204
Memory usage
210
205
------------
211
206
@@ -233,9 +228,6 @@ This table is for an 8-bit Arduino, types would be bigger on a 32-bit processor.
233
228
</table >
234
229
235
230
236
-
237
-
238
-
239
231
Code size
240
232
---------
241
233
@@ -414,4 +406,4 @@ As you'll see the code size if between 1680 and 3528 bytes, depending on the fea
414
406
<td>TOTAL</td>
415
407
<td>710</td>
416
408
</tr>
417
- </table >
409
+ </table >
0 commit comments