1
- [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/master?svg=true )] ( https://ci.appveyor.com/project/bblanchon/arduinojson/branch/master ) [ ![ Build Status] ( https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master )] ( https://travis-ci.org/bblanchon/ArduinoJson ) [ ![ Coverage Status] ( https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg )] ( https://coveralls.io/r/bblanchon/ArduinoJson?branch=master ) [ ![ Star this project] ( http://githubbadges.com/star.svg?user=bblanchon&repo=ArduinoJson&style=flat&color=fff&background=007ec6 )] ( https://github.com/bblanchon/ArduinoJson )
2
-
3
- ![ ArduinoJson's logo] ( banner.svg )
1
+ ![ ArduinoJson] ( banner.svg )
4
2
5
- ArduinoJson - C++ JSON library for IoT
6
- ====================
7
-
8
- * An elegant and efficient JSON library for embedded systems.*
3
+ ---
9
4
10
- It's designed to have the most intuitive API, the smallest footprint and is able to work without any allocation on the heap (no malloc).
5
+ [ ![ Build status ] ( https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/master?svg=true )] ( https://ci.appveyor.com/project/bblanchon/arduinojson/branch/master ) [ ![ Build Status ] ( https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master )] ( https://travis-ci.org/bblanchon/ArduinoJson ) [ ![ Coverage Status ] ( https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg )] ( https://coveralls.io/r/bblanchon/ArduinoJson?branch=master ) [ ![ Star this project ] ( http://githubbadges.com/star.svg?user=bblanchon&repo=ArduinoJson&style=flat&color=fff&background=007ec6 )] ( https://github.com/bblanchon/ArduinoJson )
11
6
12
- It has been written with Arduino in mind, but it isn't linked to Arduino libraries so you can use this library in any other C++ project.
13
- For instance, it supports Aduino's ` String ` and ` Stream ` , but also ` std::string ` , ` std::istream ` and ` std::ostream ` .
7
+ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
14
8
15
- Features
16
- --------
9
+ ## Features
17
10
18
11
* JSON decoding (comments are supported)
19
12
* JSON encoding (with optional indentation)
20
- * Elegant API, very easy to use
13
+ * Elegant API, easy to use
21
14
* Fixed memory allocation (zero malloc)
22
15
* No data duplication (zero copy)
23
- * Portable (written in C++98)
16
+ * Portable (written in C++98, can be used in any C++ project )
24
17
* Self-contained (no external dependency)
25
18
* Small footprint
26
- * Header-only library
27
- * MIT License
19
+ * Input and output streams
20
+ * [ 100% code coverage] ( https://coveralls.io/github/bblanchon/ArduinoJson )
21
+ * [ Header-only library] ( https://en.wikipedia.org/wiki/Header-only )
22
+ * [ MIT License] ( https://en.wikipedia.org/wiki/MIT_License )
28
23
* [ Comprehensive documentation] ( https://arduinojson.org )
29
24
30
- Works on
31
- --------
25
+ ## Compatibility
26
+
27
+ ArduinoJson works on the following hardware:
28
+
29
+ * <img src =" https://www.arduino.cc/favicon.ico " height =" 16 " width =" 16 " > Arduino boards: [ Uno] ( https://www.arduino.cc/en/Main/ArduinoBoardUno ) , [ Due] ( https://www.arduino.cc/en/Main/ArduinoBoardDue ) , [ Mini] ( https://www.arduino.cc/en/Main/ArduinoBoardMini ) , [ Micro] ( https://www.arduino.cc/en/Main/ArduinoBoardMicro ) , [ Yun] ( https://www.arduino.cc/en/Main/ArduinoBoardYun ) ...
30
+ * <img src =" http://espressif.com/sites/all/themes/espressif/favicon.ico " height =" 16 " width =" 16 " > Espressif chips: [ ESP8266] ( https://en.wikipedia.org/wiki/ESP8266 ) , [ ESP32] ( https://en.wikipedia.org/wiki/ESP32 )
31
+ * <img src =" https://www.wemos.cc/themes/martin-materialize-parallax/assets/favicon.ico " height =" 16 " width =" 16 " > WeMos boards: [ D1] ( https://wiki.wemos.cc/products:d1:d1 ) , [ D1 mini] ( https://wiki.wemos.cc/products:d1:d1_mini ) , ...
32
+ * <img src =" http://redbearlab.com/favicon.ico " height =" 16 " width =" 16 " > RedBearLab boards: [ BLE Nano] ( http://redbearlab.com/blenano/ ) , [ BLE Mini] ( http://redbearlab.com/blemini/ ) , [ WiFi Micro] ( https://redbear.cc/product/wifi/wifi-micro.html ) , [ LOLIN32] ( https://wiki.wemos.cc/products:lolin32:lolin32 ) ...
33
+ * <img src =" https://www.pjrc.com/favicon.ico " height =" 16 " width =" 16 " > [ Teensy] ( https://www.pjrc.com/teensy/ ) boards
34
+ * <img src =" https://software.intel.com/sites/all/themes/zero/favicon.ico " height =" 16 " width =" 16 " > Intel boards: Edison, Galileo...
35
+ * <img src =" https://www-assets.particle.io/images/favicon.png " height =" 16 " width =" 16 " > Particle boards: [ Photon] ( https://www.particle.io/products/hardware/photon-wifi-dev-kit ) , [ Electron] ( https://www.particle.io/products/hardware/electron-cellular-dev-kit ) ...
36
+ * <img src =" http://www.ti.com/favicon.ico " height =" 16 " width =" 16 " > Texas Instruments boards: [ MSP430] ( http://www.ti.com/microcontrollers/msp430-ultra-low-power-mcus/overview/overview.html ) ...
37
+
38
+ ArduinoJson compiles with zero warning on the following compilers, IDEs, and platforms:
32
39
33
- * Arduino boards: Uno, Due, Mini, Micro, Yun...
34
- * ESP8266, ESP32
35
- * Teensy
36
- * RedBearLab boards (BLE Nano...)
37
- * Intel Edison and Galileo
38
- * WeMos boards: D1...
39
- * Computers: Windows, Linux, OSX...
40
- * PlatformIO
41
- * Particle
42
- * Energia
40
+ * <img src =" https://www.arduino.cc/favicon.ico " height =" 16 " width =" 16 " > [ Arduino IDE] ( https://www.arduino.cc/en/Main/Software )
41
+ * <img src =" http://cdn.platformio.org/favicon.ico " height =" 16 " width =" 16 " > [ PlatformIO] ( http://platformio.org/ )
42
+ * <img src =" http://energia.nu/img/favicon.ico " height =" 16 " width =" 16 " > [ Energia] ( http://energia.nu/ )
43
+ * <img src =" http://www.visualmicro.com/pics/arduino-visual-studio-ld.png " height =" 16 " width =" 16 " > [ Visual Micro] ( http://www.visualmicro.com/ )
44
+ * <img src =" http://www.atmel.com/Images/favicon.ico " height =" 16 " width =" 16 " > [ Atmel Studio] ( http://www.atmel.com/microsite/atmel-studio/ )
45
+ * <img src =" https://www.iar.com/favicon.ico " height =" 16 " width =" 16 " > [ IAR Embedded Workbench] ( https://www.iar.com/iar-embedded-workbench/ )
46
+ * <img src =" http://www.st.com/etc/clientlibs/st-site/media/app/images/favicon.png " height =" 16 " width =" 16 " > [ Atollic TrueSTUDIO] ( https://atollic.com/truestudio/ )
47
+ * <img src =" http://www.keil.com/favicon.ico " height =" 16 " width =" 16 " > [ Keil uVision] ( http://www.keil.com/ )
48
+ * <img src =" http://www.microchip.com/favicon.ico " height =" 16 " width =" 16 " > [ MPLAB X IDE] ( http://www.microchip.com/mplab/mplab-x-ide )
49
+ * <img src =" https://gcc.gnu.org/favicon.ico " height =" 16 " width =" 16 " > [ GCC] ( https://gcc.gnu.org/ )
50
+ * <img src =" https://clang.llvm.org/favicon.ico " height =" 16 " width =" 16 " > [ Clang] ( https://clang.llvm.org/ )
51
+ * <img src =" https://www.visualstudio.com/favicon.ico " height =" 16 " width =" 16 " > [ Visual Studio] ( https://www.visualstudio.com/ )
43
52
44
- Quick start
45
- -----------
53
+ ## Quickstart
46
54
47
- #### Decoding / Parsing
55
+ ### Deserialization
56
+
57
+ Here is a program that parses a JSON document with ArduinoJson.
48
58
49
59
``` c++
50
60
char json[] = " {\" sensor\" :\" gps\" ,\" time\" :1351824120,\" data\" :[48.756080,2.302038]}" ;
@@ -59,11 +69,11 @@ double latitude = root["data"][0];
59
69
double longitude = root[" data" ][1 ];
60
70
```
61
71
62
- [ See JsonParserExample.ino ] ( https ://arduinojson.org/example/parser /)
72
+ See the [ tutorial on arduinojson.org ] ( http ://arduinojson.org/doc/decoding /)
63
73
64
- Use [ ArduinoJson Assistant ] ( https://arduinojson.org/assistant/ ) to compute the buffer size.
74
+ ### Serialization
65
75
66
- #### Encoding / Generating
76
+ Here is a program that generates a JSON document with ArduinoJson:
67
77
68
78
``` c++
69
79
StaticJsonBuffer<200 > jsonBuffer;
@@ -81,52 +91,17 @@ root.printTo(Serial);
81
91
// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}
82
92
```
83
93
84
- [ See JsonGeneratorExample.ino] ( https://arduinojson.org/example/generator/ )
85
-
86
- Use [ ArduinoJson Assistant] ( https://arduinojson.org/assistant/ ) to compute the buffer size.
87
-
88
-
89
- Documentation
90
- -------------
91
-
92
- The documentation is available online in the [ ArduinoJson Website] ( https://arduinojson.org/ ) .
93
-
94
- The [ ArduinoJson Assistant] ( https://arduinojson.org/assistant/ ) helps you get started with the library.
95
-
96
-
97
- Donators
98
- --------
94
+ See the [ tutorial on arduinojson.org] ( http://arduinojson.org/doc/encoding/ )
99
95
100
- Special thanks to the following persons and companies who made generous donations to the library author:
96
+ ## Documentation
101
97
102
- * Robert Murphy <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
103
- * Surge Communications <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
104
- * Alex Scott <img alt =' United Kingdom ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1ec-1f1e7.svg ' width =' 18 ' height =' 18 ' >
105
- * Firepick Services LLC <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
106
- * A B Doodkorte <img alt =' Netherlands ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f3-1f1f1.svg ' width =' 18 ' height =' 18 ' >
107
- * Scott Smith <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
108
- * Johann Stieger <img alt =' Austria ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1e6-1f1f9.svg ' width =' 18 ' height =' 18 ' >
109
- * Gustavo Donizeti Gini <img alt =' Brazil ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1e7-1f1f7.svg ' width =' 18 ' height =' 18 ' >
110
- * Charles-Henri Hallard <img alt =' France ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1eb-1f1f7.svg ' width =' 18 ' height =' 18 ' >
111
- * Martijn van den Burg <img alt =' Netherlands ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f3-1f1f1.svg ' width =' 18 ' height =' 18 ' >
112
- * Nick Koumaris <img alt =' Greece ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1ec-1f1f7.svg ' width =' 18 ' height =' 18 ' >
113
- * Jon Williams <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
114
- * Kestutis Liaugminas <img alt =' Lithuania ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f1-1f1f9.svg ' width =' 18 ' height =' 18 ' >
115
- * Darlington Adibe <img alt =' Nigeria ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f3-1f1ec.svg ' width =' 18 ' height =' 18 ' >
116
- * Yoeri Kroon <img alt =' Netherlands ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f3-1f1f1.svg' width =' 18 ' height =' 18 ' >
117
- * Andrew Melvin <img alt =' United Kingdom ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1ec-1f1e7.svg ' width =' 18 ' height =' 18 ' >
118
- * Doanh Luong <img alt =' Vietnam ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fb-1f1f3.svg ' width =' 18 ' height =' 18 ' >
119
- * Christoph Schmidt <img alt =' Germany ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1e9-1f1ea.svg ' width =' 18 ' height =' 18 ' >
120
- * OpenEVSE LLC <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
121
- * Prokhoryatov Alexey <img alt =' Russia ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f7-1f1fa.svg ' width =' 18 ' height =' 18 ' >
122
- * Google Inc. <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
123
- * Charles Haynes <img alt =' Australia ' src =' https://d1j8pt39hxlh3d.cloudfront.net/development/emojione/2.2/989/2546.svg ' width =' 18 ' height =' 18 ' >
124
- * Charles Walker <img alt =' USA ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1fa-1f1f8.svg ' width =' 18 ' height =' 18 ' >
125
- * Günther Jehle <img alt =' Liechtenstein ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1f1-1f1ee.svg ' width =' 18 ' height =' 18 ' >
126
- * Patrick Elliott
127
- * Alexander Wilms <img alt =' Germany ' src =' https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/svg/1f1e9-1f1ea.svg ' width =' 18 ' height =' 18 ' >
98
+ The documentation is available on [ arduinojson.org] ( https://arduinojson.org/ ) , here are some shortcuts:
128
99
100
+ * The [ Examples] ( https://arduinojson.org/example/ ) show how to use the library in various situations.
101
+ * The [ API Reference] ( https://arduinojson.org/api/ ) contains the description of each class and function.
102
+ * The [ FAQ] ( https://arduinojson.org/faq/ ) has the answer to virtually all questions.
103
+ * The [ ArduinoJson Assistant] ( https://arduinojson.org/assistant/ ) writes programs for you!
129
104
130
105
---
131
106
132
- Found this library useful ? Please star this project or [ help me back with a donation! ] ( https://www.paypal. com/cgi-bin/webscr?cmd=_donations&business=donate%40benoitblanchon%2efr&lc=GB&item_name=Benoit%20Blanchon&item_number=Arduino%20JSON¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted ) : smile :
107
+ Do you like this library? Please [ star this project on GitHub ] ( https://github. com/bblanchon/ArduinoJson/stargazers ) !
0 commit comments