For JSOn format using this library: GitHub - bblanchon/ArduinoJson: 📟 JSON library for Arduino and embedded C++. Simple and efficient.
-
I have defined Json using:
StaticJsonBuffer<80> jsonBuffer;
JsonArray& array = jsonBuffer.createArray(); -
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]); -
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?
-
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.