mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-07-06 06:08:22 +00:00
added signal strength
This commit is contained in:
parent
34bffdbeee
commit
2c25932e3c
1 changed files with 13 additions and 0 deletions
|
@ -69,6 +69,18 @@ Direction parseDirection(uint8_t direction)
|
||||||
throw ::std::invalid_argument("Invalid direction value: " + direction);
|
throw ::std::invalid_argument("Invalid direction value: " + direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int8_t getWiFiStrength()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return WiFi.RSSI();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
void onGetConfig(AsyncWebServerRequest *request)
|
void onGetConfig(AsyncWebServerRequest *request)
|
||||||
|
@ -208,6 +220,7 @@ void onGetStatus(AsyncWebServerRequest *request)
|
||||||
doc["heap"]["total"] = ESP.getHeapSize();
|
doc["heap"]["total"] = ESP.getHeapSize();
|
||||||
doc["psram"]["free"] = ESP.getFreePsram();
|
doc["psram"]["free"] = ESP.getFreePsram();
|
||||||
doc["psram"]["total"] = ESP.getPsramSize();
|
doc["psram"]["total"] = ESP.getPsramSize();
|
||||||
|
doc["connection"]["signalStrength"] = getWiFiStrength();
|
||||||
|
|
||||||
String jsonString;
|
String jsonString;
|
||||||
serializeJson(doc, jsonString);
|
serializeJson(doc, jsonString);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue