mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-07-12 00:15:44 +00:00
switched status logic to separate file
This commit is contained in:
parent
2c25932e3c
commit
4ac0681a9a
5 changed files with 42 additions and 38 deletions
|
@ -69,18 +69,6 @@ Direction parseDirection(uint8_t direction)
|
|||
throw ::std::invalid_argument("Invalid direction value: " + direction);
|
||||
}
|
||||
|
||||
int8_t getWiFiStrength()
|
||||
{
|
||||
try
|
||||
{
|
||||
return WiFi.RSSI();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
void onGetConfig(AsyncWebServerRequest *request)
|
||||
|
@ -202,27 +190,3 @@ void onGetNetworks(AsyncWebServerRequest *request)
|
|||
serializeJson(doc, jsonString);
|
||||
request->send(200, "application/json", jsonString);
|
||||
}
|
||||
|
||||
void onGetStatus(AsyncWebServerRequest *request)
|
||||
{
|
||||
JsonDocument doc;
|
||||
|
||||
doc["uptime"] = millis();
|
||||
doc["chip"]["model"] = ESP.getChipModel();
|
||||
doc["chip"]["mac"] = ESP.getEfuseMac();
|
||||
doc["chip"]["revision"] = ESP.getChipRevision();
|
||||
doc["chip"]["cpuFreqMHz"] = ESP.getCpuFreqMHz();
|
||||
doc["chip"]["cycleCount"] = ESP.getCycleCount();
|
||||
doc["sdkVersion"] = ESP.getSdkVersion();
|
||||
doc["sketch"]["size"] = ESP.getSketchSize();
|
||||
doc["sketch"]["md5"] = ESP.getSketchMD5();
|
||||
doc["heap"]["free"] = ESP.getFreeHeap();
|
||||
doc["heap"]["total"] = ESP.getHeapSize();
|
||||
doc["psram"]["free"] = ESP.getFreePsram();
|
||||
doc["psram"]["total"] = ESP.getPsramSize();
|
||||
doc["connection"]["signalStrength"] = getWiFiStrength();
|
||||
|
||||
String jsonString;
|
||||
serializeJson(doc, jsonString);
|
||||
request->send(200, "application/json", jsonString);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue