Nested Array Can Not Contain Other Arrays? · Issue #51 - GitHub

Skip to content Dismiss alert {{ message }} / ArduinoJson Public
  • Uh oh!

    There was an error while loading. Please reload this page.

  • Notifications You must be signed in to change notification settings
  • Fork 1.2k
  • Star 7.1k
  • Code
  • Issues 17
  • Pull requests
  • Actions
  • Security

    Uh oh!

    There was an error while loading. Please reload this page.

  • Insights
Additional navigation options nested Array can not contain other arrays? #51New issueNew issueClosedClosednested Array can not contain other arrays?#51Labelsquestionv5ArduinoJson 5@lazyzero

Description

@lazyzerolazyzeroopened on Feb 26, 2015

Hi,

I like to do something like

JsonArray& data = root.createNestedArray("data");

JsonArray& data1 = data.createNestedArray("data1"); data1.add(48.756080, 6); data1.add(2.302038, 6); JsonArray& data2 = data.createNestedArray("data2"); data2.add(48.756080, 6); data2.add(2.302038, 6);

data.add(data1); data.add(data2);

But get this compilation error JsonGeneratorExample.ino:19:52: error: no matching function for call to 'ArduinoJson::JsonArray::createNestedArray(const char [6])' JsonGeneratorExample.ino:19:52: note: candidate is: In file included from /home/cccc/Arduino_sketchbook/libraries/ArduinoJson/include/ArduinoJson.h:8:0, from /home/cccc/Arduino_sketchbook/libraries/ArduinoJson/ArduinoJson.h:11, from JsonGeneratorExample.ino:7: /home/cccc/Arduino_sketchbook/libraries/ArduinoJson/include/../include/ArduinoJson/JsonArray.hpp:68:14: note: ArduinoJson::JsonArray& ArduinoJson::JsonArray::createNestedArray() JsonArray &createNestedArray();

My JSON string should look like this {"sensor":"gps","time":1351824120,"data":[[48.756080,2.302038],[48.756080,2.302038]]}

Isn't this possible or where is my error?

Best Christian

Metadata

Metadata

Assignees

No one assigned

Labels

questionv5ArduinoJson 5

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You can’t perform that action at this time.

Tag » Arduino Json 6 Nested Array