Return JsonArray and JsonObject by value (closes #309)

This commit is contained in:
Benoit Blanchon
2018-07-02 09:35:21 +02:00
parent 4fe2b1100e
commit b105e6f7c4
93 changed files with 983 additions and 1091 deletions

View File

@ -24,7 +24,7 @@ void setup() {
// DynamicJsonDocument doc(200);
// Make our document be an object
JsonObject& root = doc.to<JsonObject>();
JsonObject root = doc.to<JsonObject>();
// Add values in the object
//
@ -35,7 +35,7 @@ void setup() {
// Add an array.
//
JsonArray& data = root.createNestedArray("data");
JsonArray data = root.createNestedArray("data");
data.add(48.756080);
data.add(2.302038);
@ -61,15 +61,4 @@ void loop() {
// not used in this example
}
// See also
// --------
//
// The website arduinojson.org contains the documentation for all the functions
// used above. It also includes an FAQ that will help you solve any
// serialization problem.
// Please check it out at: https://arduinojson.org/
//
// The book "Mastering ArduinoJson" contains a tutorial on serialization.
// It begins with a simple example, like the one above, and then adds more
// features like serializing directly to a file or an HTTP request.
// Please check it out at: https://arduinojson.org/book/
// Visit https://arduinojson.org/v6/example/generator/ for more.