Add IP address and rssi to /json/report

This commit is contained in:
Jm
2020-12-27 15:03:32 -08:00
parent 0e507e1923
commit 621306e610
2 changed files with 16 additions and 4 deletions

View File

@@ -1117,8 +1117,20 @@ void handleReport(HTTPRequest *req, HTTPResponse *res)
res->println("},");
res->println("\"something\": 123,");
res->println("\"something_else\": 123");
res->println("\"wifi\": {");
res->println("\"rssi\": " + String(WiFi.RSSI()) + ",");
if (radioConfig.preferences.wifi_ap_mode || isSoftAPForced()) {
res->println("\"ip\": \"" + String(WiFi.softAPIP().toString().c_str()) + "\"");
} else {
res->println("\"ip\": \"" + String(WiFi.localIP().toString().c_str()) + "\"");
}
res->println("},");
res->println("\"test\": 123");
res->println("},");