- Notifications
You must be signed in to change notification settings - Fork150
Open
Description
Actually, I have the following definition:
structSensor {int value;int type;};classSensorState {public: Sensor sensors[4];staticvoidread(SensorState& settings, JsonObject& root) {for (int i =0; i <4; i++) { root["value"][i] = settings.sensors[i].value; root["type"][i] = settings.sensors[i].type; } }...};
I would like to use a JSON array instead of an object to have code that looks more like this:
classSensorState {public: Sensor sensors[4];staticvoidread(SensorState& settings, JsonArray& root) {for (int i =0; i <4; i++) { root[i]["value"] = settings.sensors[i].value; root[i]["type"] = settings.sensors[i].type; } }...};
Do you know how I can do that?
I tried modifying StatefullService to accept arrays, but I confess I'm not proficient enough in C++ to accomplish it.
I love this framework and I congratulate@rjwats once again for creating it.
It would be great in my case if I could pass arrays instead of objects.
Metadata
Metadata
Assignees
Labels
No labels