Upgrades ArduinoJson from version 6 to 7

This commit is contained in:
Rune Harlyk
2024-05-07 10:36:16 +02:00
committed by Rune Harlyk
parent 2b4d196e7c
commit a150caad9d
39 changed files with 241 additions and 561 deletions
@@ -50,8 +50,6 @@
#define WIFI_RECONNECTION_DELAY 1000 * 30
#define RSSI_EVENT_DELAY 500
#define WIFI_SETTINGS_BUFFER_SIZE 2048
#define EVENT_RSSI "rssi"
#define EVENT_WIFI_SETTINGS "WiFiSettings"
@@ -83,13 +81,13 @@ public:
root["priority_RSSI"] = settings.priorityBySignalStrength;
// create JSON array from root
JsonArray wifiNetworks = root.createNestedArray("wifi_networks");
JsonArray wifiNetworks = root["wifi_networks"].to<JsonArray>();
// iterate over the wifiSettings
for (auto &wifi : settings.wifiSettings)
{
// create JSON object for each wifi network
JsonObject wifiNetwork = wifiNetworks.createNestedObject();
JsonObject wifiNetwork = wifiNetworks.add<JsonObject>();
// add the ssid and password to the JSON object
wifiNetwork["ssid"] = wifi.ssid;