From 73afe3a0f548fc1df65c2afff4ae9eea1a1def54 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 20 Sep 2026 14:22:13 +1200 Subject: [PATCH] allow fetching configured wifi password via companion cli --- examples/companion_radio/MyMesh.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index c38fa70a..79b4a8ce 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -2191,6 +2191,10 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char* strcpy(reply, "> wifi.pwd updated (reboot to apply)"); return true; } + if (strcmp(command, "get wifi.pwd") == 0) { + sprintf(reply, "> %s", _prefs.wifi_pwd); + return true; + } if (strcmp(command, "set wifi.clear") == 0) { _prefs.wifi_ssid[0] = 0; _prefs.wifi_pwd[0] = 0; @@ -2198,7 +2202,7 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char* strcpy(reply, "> wifi config cleared (reboot to apply)"); return true; } - if (strcmp(command, "get wifi.ssid") == 0) { // no 'get wifi.pwd', by design + if (strcmp(command, "get wifi.ssid") == 0) { sprintf(reply, "> %s", _prefs.getWifiSSID()[0] ? _prefs.getWifiSSID() : "(not set)"); return true; }