From ec1cd4438279a36ae6dcda7f3e121add06ab1f73 Mon Sep 17 00:00:00 2001 From: Gregg Date: Thu, 27 Apr 2023 19:53:33 -0500 Subject: [PATCH] Small tweaks to reset reasons in web log --- src/HAP.cpp | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/HAP.cpp b/src/HAP.cpp index e7df1f8..118da3e 100644 --- a/src/HAP.cpp +++ b/src/HAP.cpp @@ -1254,50 +1254,45 @@ int HAPClient::getStatusURL(){ response+="Current Time:" + String(clocktime) + "\n"; response+="Boot Time:" + String(homeSpan.webLog.bootTime) + "\n"; - response+="Reset Reason Code:" + String(esp_reset_reason()) + " - "; + response+="Reset Reason:"; switch(esp_reset_reason()) { case ESP_RST_UNKNOWN: - response += "Reset reason can not be determined."; + response += "Cannot be determined"; break; case ESP_RST_POWERON: - response += "Reset due to power-on event."; + response += "Power-on event"; break; case ESP_RST_EXT: - response += "Reset by external pin (not applicable for ESP32)."; + response += "External pin"; break; case ESP_RST_SW: - response += "Software reset via esp_restart."; + response += "Software reboot via esp_restart"; break; case ESP_RST_PANIC: - response += "Software reset due to exception/panic."; + response += "Software Exception/Panic"; break; case ESP_RST_INT_WDT: - response += "Reset (software or hardware) due to interrupt watchdog."; + response += "Interrupt watchdog"; break; case ESP_RST_TASK_WDT: - response += "Reset due to task watchdog."; + response += "Task watchdog"; break; case ESP_RST_WDT: - response += "Reset due to other watchdogs."; + response += "Other watchdogs"; break; case ESP_RST_DEEPSLEEP: - response += "Reset after exiting deep sleep mode."; + response += "Exiting deep sleep mode"; break; case ESP_RST_BROWNOUT: - response += "Brownout reset (software or hardware)."; + response += "Brownout"; break; case ESP_RST_SDIO: - response += "Reset over SDIO."; + response += "SDIO"; break; - /* HomeSpan not yet upgraded to support this one.. - case ESP_RST_USB: - response += "Reset by USB peripheral."; - break; - */ default: - response += "No description available, contact HomeSpan maintainers."; + response += "Unknown Reset Code"; } - response+="\n"; + response+=" (" + String(esp_reset_reason()) + ")\n"; response+="WiFi Disconnects:" + String(homeSpan.connected/2) + "\n"; response+="WiFi Signal:" + String(WiFi.RSSI()) + " dBm\n";