Arduino Json library query; Atmega2560

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
594
For JSOn format using this library: https://github.com/bblanchon/ArduinoJson

1. I have defined Json using:
StaticJsonBuffer<80> jsonBuffer;
JsonArray& array = jsonBuffer.createArray();

2. Now I keep on using add operator like as below & keep on adding values in array like this:
array.add("Value");
array.add(data[0]);

3. After one loop, I want to reinit the Json array index to 0 again. So that when I now add values , it should again start from index 0. How to do that?

4. Second question is how to know how much array size is filled in Json array at any point of time. This will help in case, intiially I will define a large array, now when I keep on adding values in it, in the end I want to know whats its size know. So that I can optimize the size of initially defined Json array.

In the end I have to send this JSON generated string on SIM800 on a known IP address & port number.
 
Top