mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-12-23 15:28:09 +01:00
Save some bytes on the wifi scanned result payload format
This commit is contained in:
@@ -630,15 +630,15 @@ String WifiConnector::buildPaginatedWiFiJSON(WiFiNetwork networks[], int totalFo
|
|||||||
|
|
||||||
for (int i = startIdx; i < endIdx; i++) {
|
for (int i = startIdx; i < endIdx; i++) {
|
||||||
JSONVar obj;
|
JSONVar obj;
|
||||||
obj["ssid"] = networks[i].ssid;
|
obj["s"] = networks[i].ssid;
|
||||||
obj["rssi"] = networks[i].rssi;
|
obj["r"] = networks[i].rssi;
|
||||||
obj["open"] = networks[i].open;
|
obj["o"] = networks[i].open ? 1 : 0;
|
||||||
jsonArray[i - startIdx] = obj;
|
jsonArray[i - startIdx] = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonRoot["wifi"] = jsonArray;
|
jsonRoot["wifi"] = jsonArray;
|
||||||
jsonRoot["page"] = page;
|
jsonRoot["page"] = page;
|
||||||
jsonRoot["totalPage"] = totalPages;
|
jsonRoot["tpage"] = totalPages;
|
||||||
jsonRoot["found"] = totalFound;
|
jsonRoot["found"] = totalFound;
|
||||||
|
|
||||||
String jsonString = JSON.stringify(jsonRoot);
|
String jsonString = JSON.stringify(jsonRoot);
|
||||||
|
|||||||
Reference in New Issue
Block a user