Trim WiFi credentials from setup commands

This commit is contained in:
2026-06-04 14:01:15 -06:00
parent 12304b268c
commit 32069950b0
@@ -1051,7 +1051,9 @@ void handleDebugSerial() {
if (command.startsWith("wifi ssid ")) {
staSsids[0] = command.substring(10);
String ssid = command.substring(10);
ssid.trim();
staSsids[0] = ssid;
staPriorities[0] = 1;
if (wifiNetworkCount < 1) wifiNetworkCount = 1;
Serial.println("OK WiFi SSID 1 updated");
@@ -1060,7 +1062,9 @@ void handleDebugSerial() {
}
if (command.startsWith("wifi pass ")) {
staPasswords[0] = command.substring(10);
String password = command.substring(10);
password.trim();
staPasswords[0] = password;
staPriorities[0] = 1;
if (wifiNetworkCount < 1) wifiNetworkCount = 1;
Serial.println("OK WiFi password 1 updated");
@@ -1094,6 +1098,9 @@ void handleDebugSerial() {
if (priority <= 0) priority = wifiNetworkCount + 1;
}
ssid.trim();
password.trim();
staSsids[wifiNetworkCount] = ssid;
staPasswords[wifiNetworkCount] = password;
staPriorities[wifiNetworkCount] = priority;