mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
always show wifi when in system context
This commit is contained in:
@@ -381,63 +381,61 @@ void System::show_system(uuid::console::Shell & shell) {
|
|||||||
shell.printfln(F("Free mem: %d %%"), free_mem());
|
shell.printfln(F("Free mem: %d %%"), free_mem());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (shell.has_flags(CommandFlags::ADMIN)) {
|
shell.println();
|
||||||
shell.println();
|
|
||||||
|
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
|
|
||||||
switch (WiFi.status()) {
|
switch (WiFi.status()) {
|
||||||
case WL_IDLE_STATUS:
|
case WL_IDLE_STATUS:
|
||||||
shell.printfln(F("WiFi: idle"));
|
shell.printfln(F("WiFi: idle"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WL_NO_SSID_AVAIL:
|
case WL_NO_SSID_AVAIL:
|
||||||
shell.printfln(F("WiFi: network not found"));
|
shell.printfln(F("WiFi: network not found"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WL_SCAN_COMPLETED:
|
case WL_SCAN_COMPLETED:
|
||||||
shell.printfln(F("WiFi: network scan complete"));
|
shell.printfln(F("WiFi: network scan complete"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WL_CONNECTED: {
|
case WL_CONNECTED: {
|
||||||
shell.printfln(F("WiFi: connected"));
|
shell.printfln(F("WiFi: connected"));
|
||||||
shell.println();
|
shell.println();
|
||||||
|
|
||||||
shell.printfln(F("SSID: %s"), WiFi.SSID().c_str());
|
shell.printfln(F("SSID: %s"), WiFi.SSID().c_str());
|
||||||
shell.printfln(F("BSSID: %s"), WiFi.BSSIDstr().c_str());
|
shell.printfln(F("BSSID: %s"), WiFi.BSSIDstr().c_str());
|
||||||
shell.printfln(F("RSSI: %d dBm (%d %%)"), WiFi.RSSI(), wifi_quality());
|
shell.printfln(F("RSSI: %d dBm (%d %%)"), WiFi.RSSI(), wifi_quality());
|
||||||
shell.println();
|
shell.println();
|
||||||
|
|
||||||
shell.printfln(F("MAC address: %s"), WiFi.macAddress().c_str());
|
shell.printfln(F("MAC address: %s"), WiFi.macAddress().c_str());
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
shell.printfln(F("Hostname: %s"), WiFi.hostname().c_str());
|
shell.printfln(F("Hostname: %s"), WiFi.hostname().c_str());
|
||||||
#elif defined(ESP32)
|
#elif defined(ESP32)
|
||||||
shell.printfln(F("Hostname: %s"), WiFi.getHostname());
|
shell.printfln(F("Hostname: %s"), WiFi.getHostname());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
shell.println();
|
shell.println();
|
||||||
shell.printfln(F("IPv4 address: %s/%s"), uuid::printable_to_string(WiFi.localIP()).c_str(), uuid::printable_to_string(WiFi.subnetMask()).c_str());
|
shell.printfln(F("IPv4 address: %s/%s"), uuid::printable_to_string(WiFi.localIP()).c_str(), uuid::printable_to_string(WiFi.subnetMask()).c_str());
|
||||||
shell.printfln(F("IPv4 gateway: %s"), uuid::printable_to_string(WiFi.gatewayIP()).c_str());
|
shell.printfln(F("IPv4 gateway: %s"), uuid::printable_to_string(WiFi.gatewayIP()).c_str());
|
||||||
shell.printfln(F("IPv4 nameserver: %s"), uuid::printable_to_string(WiFi.dnsIP()).c_str());
|
shell.printfln(F("IPv4 nameserver: %s"), uuid::printable_to_string(WiFi.dnsIP()).c_str());
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WL_CONNECT_FAILED:
|
case WL_CONNECT_FAILED:
|
||||||
shell.printfln(F("WiFi: connection failed"));
|
shell.printfln(F("WiFi: connection failed"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WL_CONNECTION_LOST:
|
case WL_CONNECTION_LOST:
|
||||||
shell.printfln(F("WiFi: connection lost"));
|
shell.printfln(F("WiFi: connection lost"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WL_DISCONNECTED:
|
case WL_DISCONNECTED:
|
||||||
shell.printfln(F("WiFi: disconnected"));
|
shell.printfln(F("WiFi: disconnected"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WL_NO_SHIELD:
|
case WL_NO_SHIELD:
|
||||||
default:
|
default:
|
||||||
shell.printfln(F("WiFi: unknown"));
|
shell.printfln(F("WiFi: unknown"));
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user