Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 3d405ca

Browse files
committed
third-party: bump arduino-json to 5.2
1 parent 9ad4b70 commit 3d405ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4555
-0
lines changed
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
ArduinoJson: change log
2+
=======================
3+
4+
v5.2.0
5+
------
6+
7+
* Added `JsonVariant::as<char*>()` as a synonym for `JsonVariant::as<const char*>()` (issue #257)
8+
* Added example `JsonHttpClient` (issue #256)
9+
* Added `JsonArray::copyTo()` and `JsonArray::copyFrom()` (issue #254)
10+
* Added `RawJson()` to insert pregenerated JSON portions (issue #259)
11+
12+
v5.1.1
13+
------
14+
15+
* Removed `String` duplication when one replaces a value in a `JsonObject` (PR #232 by @ulion)
16+
17+
v5.1.0
18+
------
19+
20+
* Added support of `long long` (issue #171)
21+
* Moved all build settings to `ArduinoJson/Configuration.hpp`
22+
23+
**BREAKING CHANGE**:
24+
If you defined `ARDUINOJSON_ENABLE_STD_STREAM`, you now need to define it to `1`.
25+
26+
v5.0.8
27+
------
28+
29+
* Made the library compatible with [PlatformIO](http://platformio.org/) (issue #181)
30+
* Fixed `JsonVariant::is<bool>()` that was incorrectly returning false (issue #214)
31+
32+
v5.0.7
33+
------
34+
35+
* Made library easier to use from a CMake project: simply `add_subdirectory(ArduinoJson/src)`
36+
* Changed `String` to be a `typedef` of `std::string` (issues #142 and #161)
37+
38+
**BREAKING CHANGES**:
39+
- `JsonVariant(true).as<String>()` now returns `"true"` instead of `"1"`
40+
- `JsonVariant(false).as<String>()` now returns `"false"` instead of `"0"`
41+
42+
v5.0.6
43+
------
44+
45+
* Added parameter to `DynamicJsonBuffer` constructor to set initial size (issue #152)
46+
* Fixed warning about library category in Arduino 1.6.6 (issue #147)
47+
* Examples: Added a loop to wait for serial port to be ready (issue #156)
48+
49+
v5.0.5
50+
------
51+
52+
* Added overload `JsonObjectSuscript::set(value, decimals)` (issue #143)
53+
* Use `float` instead of `double` to reduce the size of `JsonVariant` (issue #134)
54+
55+
v5.0.4
56+
------
57+
58+
* Fixed ambiguous overload with `JsonArraySubscript` and `JsonObjectSubscript` (issue #122)
59+
60+
v5.0.3
61+
------
62+
63+
* Fixed `printTo(String)` which wrote numbers instead of strings (issue #120)
64+
* Fixed return type of `JsonArray::is<T>()` and some others (issue #121)
65+
66+
v5.0.2
67+
------
68+
69+
* Fixed segmentation fault in `parseObject(String)` and `parseArray(String)`, when the
70+
`StaticJsonBuffer` is too small to hold a copy of the string
71+
* Fixed Clang warning "register specifier is deprecated" (issue #102)
72+
* Fixed GCC warning "declaration shadows a member" (issue #103)
73+
* Fixed memory alignment, which made ESP8266 crash (issue #104)
74+
* Fixed compilation on Visual Studio 2010 and 2012 (issue #107)
75+
76+
v5.0.1
77+
------
78+
79+
* Fixed compilation with Arduino 1.0.6 (issue #99)
80+
81+
v5.0.0
82+
------
83+
84+
* Added support of `String` class (issues #55, #56, #70, #77)
85+
* Added `JsonBuffer::strdup()` to make a copy of a string (issues #10, #57)
86+
* Implicitly call `strdup()` for `String` but not for `char*` (issues #84, #87)
87+
* Added support of non standard JSON input (issue #44)
88+
* Added support of comments in JSON input (issue #88)
89+
* Added implicit cast between numerical types (issues #64, #69, #93)
90+
* Added ability to read number values as string (issue #90)
91+
* Redesigned `JsonVariant` to leverage converting constructors instead of assignment operators (issue #66)
92+
* Switched to new the library layout (requires Arduino 1.0.6 or above)
93+
94+
**BREAKING CHANGES**:
95+
- `JsonObject::add()` was renamed to `set()`
96+
- `JsonArray::at()` and `JsonObject::at()` were renamed to `get()`
97+
- Number of digits of floating point value are now set with `double_with_n_digits()`
98+
99+
**Personal note about the `String` class**:
100+
Support of the `String` class has been added to the library because many people use it in their programs.
101+
However, you should not see this as an invitation to use the `String` class.
102+
The `String` class is **bad** because it uses dynamic memory allocation.
103+
Compared to static allocation, it compiles to a bigger, slower program, and is less predictable.
104+
You certainly don't want that in an embedded environment!
105+
106+
v4.6
107+
----
108+
109+
* Fixed segmentation fault in `DynamicJsonBuffer` when memory allocation fails (issue #92)
110+
111+
v4.5
112+
----
113+
114+
* Fixed buffer overflow when input contains a backslash followed by a terminator (issue #81)
115+
116+
**Upgrading is recommended** since previous versions contain a potential security risk.
117+
118+
Special thanks to [Giancarlo Canales Barreto](https://github.com/gcanalesb) for finding this nasty bug.
119+
120+
v4.4
121+
----
122+
123+
* Added `JsonArray::measureLength()` and `JsonObject::measureLength()` (issue #75)
124+
125+
v4.3
126+
----
127+
128+
* Added `JsonArray::removeAt()` to remove an element of an array (issue #58)
129+
* Fixed stack-overflow in `DynamicJsonBuffer` when parsing huge JSON files (issue #65)
130+
* Fixed wrong return value of `parseArray()` and `parseObject()` when allocation fails (issue #68)
131+
132+
v4.2
133+
----
134+
135+
* Switched back to old library layout (issues #39, #43 and #45)
136+
* Removed global new operator overload (issue #40, #45 and #46)
137+
* Added an example with EthernetServer
138+
139+
v4.1
140+
----
141+
142+
* Added DynamicJsonBuffer (issue #19)
143+
144+
v4.0
145+
----
146+
147+
* Unified parser and generator API (issue #23)
148+
* Updated library layout, now requires Arduino 1.0.6 or newer
149+
150+
**BREAKING CHANGE**: API changed significantly, see [Migrating code to the new API](https://github.com/bblanchon/ArduinoJson/wiki/Migrating-code-to-the-new-API).
151+
152+
153+
v3.4
154+
----
155+
156+
* Fixed escaped char parsing (issue #16)
157+
158+
159+
v3.3
160+
----
161+
162+
* Added indented output for the JSON generator (issue #11), see example bellow.
163+
* Added `IndentedPrint`, a decorator for `Print` to allow indented output
164+
165+
Example:
166+
167+
JsonOject<2> json;
168+
json["key"] = "value";
169+
json.prettyPrintTo(Serial);
170+
171+
v3.2
172+
----
173+
174+
* Fixed a bug when adding nested object in `JsonArray` (bug introduced in v3.1).
175+
176+
v3.1
177+
----
178+
179+
* Calling `Generator::JsonObject::add()` twice with the same `key` now replaces the `value`
180+
* Added `Generator::JsonObject::operator[]`, see bellow the new API
181+
* Added `Generator::JsonObject::remove()` (issue #9)
182+
183+
Old generator API:
184+
185+
JsonObject<3> root;
186+
root.add("sensor", "gps");
187+
root.add("time", 1351824120);
188+
root.add("data", array);
189+
190+
New generator API:
191+
192+
JsonObject<3> root;
193+
root["sensor"] = "gps";
194+
root["time"] = 1351824120;
195+
root["data"] = array;
196+
197+
v3.0
198+
----
199+
200+
* New parser API, see bellow
201+
* Renamed `JsonHashTable` into `JsonObject`
202+
* Added iterators for `JsonArray` and `JsonObject` (issue #4)
203+
204+
Old parser API:
205+
206+
JsonHashTable root = parser.parseHashTable(json);
207+
208+
char* sensor = root.getString("sensor");
209+
long time = root.getLong("time");
210+
double latitude = root.getArray("data").getDouble(0);
211+
double longitude = root.getArray("data").getDouble(1);
212+
213+
New parser API:
214+
215+
JsonObject root = parser.parse(json);
216+
217+
char* sensor = root["sensor"];
218+
long time = root["time"];
219+
double latitude = root["data"][0];
220+
double longitude = root["data"][1];
221+
222+
v2.1
223+
----
224+
225+
* Fixed case `#include "jsmn.cpp"` which caused an error in Linux (issue #6)
226+
* Fixed a buffer overrun in JSON Parser (issue #5)
227+
228+
v2.0
229+
----
230+
231+
* Added JSON encoding (issue #2)
232+
* Renamed the library `ArduinoJsonParser` becomes `ArduinoJson`
233+
234+
**Breaking change**: you need to add the following line at the top of your program.
235+
236+
using namespace ArduinoJson::Parser;
237+
238+
v1.2
239+
----
240+
241+
* Fixed error in JSON parser example (issue #1)
242+
243+
v1.1
244+
----
245+
246+
* Example: changed `char* json` into `char[] json` so that the bytes are not write protected
247+
* Fixed parsing bug when the JSON contains multi-dimensional arrays
248+
249+
v1.0
250+
----
251+
252+
Initial release
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The MIT License (MIT)
2+
---------------------
3+
4+
Copyright © 2014-2016 Benoit BLANCHON
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
Arduino JSON library
2+
====================
3+
4+
[![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)
5+
6+
*An elegant and efficient JSON library for embedded systems.*
7+
8+
It's designed to have the most intuitive API, the smallest footprint and works without any allocation on the heap (no malloc).
9+
10+
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.
11+
12+
Features
13+
--------
14+
15+
* JSON decoding (comments are supported)
16+
* JSON encoding (with optional indentation)
17+
* Elegant API, very easy to use
18+
* Fixed memory allocation (zero malloc)
19+
* No data duplication (zero copy)
20+
* Portable (written in C++98)
21+
* Self-contained (no external dependency)
22+
* Small footprint
23+
* MIT License
24+
25+
Works on
26+
--------
27+
28+
* All Arduino boards (Uno, Due, Mini, Micro, Yun...)
29+
* ESP8266
30+
* Teensy
31+
* Intel Edison
32+
* PlatformIO
33+
* Energia
34+
* RedBearLab boards (BLE Nano...)
35+
* Computers (Windows, Linux, OSX...)
36+
37+
See [FAQ: Compatibility issues](https://github.com/bblanchon/ArduinoJson/wiki/Compatibility-issues)
38+
39+
Quick start
40+
-----------
41+
42+
#### Decoding / Parsing
43+
44+
```c++
45+
char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
46+
47+
StaticJsonBuffer<200> jsonBuffer;
48+
49+
JsonObject& root = jsonBuffer.parseObject(json);
50+
51+
const char* sensor = root["sensor"];
52+
long time = root["time"];
53+
double latitude = root["data"][0];
54+
double longitude = root["data"][1];
55+
```
56+
57+
#### Encoding / Generating
58+
59+
```c++
60+
StaticJsonBuffer<200> jsonBuffer;
61+
62+
JsonObject& root = jsonBuffer.createObject();
63+
root["sensor"] = "gps";
64+
root["time"] = 1351824120;
65+
66+
JsonArray& data = root.createNestedArray("data");
67+
data.add(48.756080, 6); // 6 is the number of decimals to print
68+
data.add(2.302038, 6); // if not specified, 2 digits are printed
69+
70+
root.printTo(Serial);
71+
// This prints:
72+
// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}
73+
```
74+
75+
76+
Documentation
77+
-------------
78+
79+
The documentation is available online in the [Arduino JSON wiki](https://github.com/bblanchon/ArduinoJson/wiki)
80+
81+
Testimonials
82+
------------
83+
84+
From Arduino's Forum user `jflaplante`:
85+
> I tried aJson json-arduino before trying your library. I always ran into memory problem after a while.
86+
> I have no such problem so far with your library. It is working perfectly with my web services.
87+
88+
From Arduino's Forum user `gbathree`:
89+
> Thanks so much - this is an awesome library! If you want to see what we're doing with it - the project is located at www.photosynq.org.
90+
91+
From StackOverflow user `thegreendroid`:
92+
> It has a really elegant, simple API and it works like a charm on embedded and Windows/Linux platforms. We recently started using this on an embedded project and I can vouch for its quality.
93+
94+
From GitHub user `zacsketches`:
95+
> Thanks for a great library!!!
96+
> I've been watching you consistently develop this library over the past six months, and I used it today for a publish and subscribe architecture designed to help hobbyists move into more advanced robotics. Your library allowed me to implement remote subscription in order to facilitate multi-processor robots.
97+
> ArduinoJson saved me a week's worth of time!!
98+
99+
[From Reddit user `erm_what_`](https://www.reddit.com/r/arduino/comments/3jj6ep/announcing_arduinojson_50/cusjk8c):
100+
> This is a great library and I wouldn't be able to do the project I'm doing without it. I completely recommend it.
101+
102+
[From Reddit user `makerhacks`](https://www.reddit.com/r/arduino/comments/3jj6ep/announcing_arduinojson_50/cusqg7b):
103+
> I am just starting an ESP8266 clock project and now I can output JSON from my server script and interpret it painlessly.
104+
105+
[From Twitter user `@hemalchevli`](https://twitter.com/hemalchevli/status/715788439397011456):
106+
> ArduinoJson library should be used as a benchmark/reference for making libraries. Truly elegant.
107+
108+
Donators
109+
--------
110+
111+
Special thanks to the following persons and companies who made generous donations to the library author:
112+
113+
* Robert Murphy
114+
* Surge Communications
115+
* Alex Scott
116+
* Firepick Services LLC
117+
* A B Doodkorte
118+
* Scott Smith
119+
* Johann Stieger
120+
* Gustavo Donizeti Gini
121+
122+
---
123+
124+
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&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) :smile:

0 commit comments

Comments
 (0)