A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
add method to display wifi state on the screen
Geoa8e40b451a8d
diff --git a/src/Controllers/WifiController.cpp b/src/Controllers/WifiController.cppindex 40fe2799..828b16fa 100644--- a/src/Controllers/WifiController.cpp+++ b/src/Controllers/WifiController.cpp@@ -31,6 +31,42 @@ void WifiController::handleCommand(const TerminalCommand &cmd)else handleHelp();}+std::vector<std::string> WifiController::buildWiFiLines() {+ std::vector<std::string> lines;+ lines.reserve(4);++ int mode = wifiService.getWifiModeRaw();+ int status = wifiService.getWifiStatusRaw();++ // MODE+ lines.push_back(+ std::string("MODE ") + WifiService::wifiModeToStr(mode)+ );++ // Disconnection+ if (status != WL_CONNECTED) {+ lines.push_back("WIFI DISCONNECTED");+ return lines;+ }++ // Connected+ lines.push_back("WIFI CONNECTED");++ // STA IP+ std::string staIp = wifiService.getLocalIP();+ if (!staIp.empty())+ lines.push_back(staIp);++ // SSID+ std::string ssid = wifiService.getSsid();+ if (!ssid.empty()) {+ std::string nameLimited = ssid.length() > 15 ? ssid.substr(0, 15) + "..." : ssid;+ lines.push_back(nameLimited);+ }++ return lines;+}+/*Connect*/diff --git a/src/Controllers/WifiController.h b/src/Controllers/WifiController.hindex a492c902..0240752c 100644--- a/src/Controllers/WifiController.h+++ b/src/Controllers/WifiController.h@@ -26,6 +26,9 @@ public:// Ensure WiFi is configured before any actionvoid ensureConfigured();+ // Build current connection state+ std::vector<std::string> buildWiFiLines();+private:GlobalState& state = GlobalState::getInstance();bool configured = false;