I used to send data to the server using a one-dimensional array in C Arduino language. Now, I need to figure out how to send a two-dimensional array instead.
typedef struct {
String Name;
String addr;
String ttl;
}officeKownNetworks;
officeKownNetworks officeDevice;
JSONVar readings;
String KnownMacDetails() {
while(true) {
readings["addrDeviceUser"] = officeDevice.Name;
readings["addr"] = officeDevice.addr;
String jsonString = JSON.stringify(readings);
return jsonString;
}
};
Previously, I used SPIFFS to send the data to Javascript.
server.on("/clientsniffer", HTTP_GET, [](AsyncWebServerRequest *request){
String json = KnownMacDetails();
request->send(200, "application/json", json);
json = String();
});
However, I'm now facing challenges with sending and receiving data from a two-dimensional array.
In my case, Mac addresses are stored in a loop within an array of maclist [64] [3];
How do I transmit this array data to the server and retrieve it in Javascript? What parameters should I use?
Any guidance is greatly appreciated.
While I have successfully sent a one-dimensional array through JSON, I now seek assistance on handling a two-dimensional array's communication between the server and Javascript.