Add dedicated BMS setup scan mode

This commit is contained in:
2026-06-04 02:44:44 -06:00
parent 98121e29f6
commit 8ba881bae6
3 changed files with 107 additions and 55 deletions
@@ -374,39 +374,18 @@ void handleDebugSerial() {
return;
}
if (command == "enter setup") {
enterBmsSetupMode();
return;
}
if (command == "exit setup") {
exitBmsSetupMode();
return;
}
if (command == "scan ble") {
int count = scanBleDevices(20);
if (count == 0) {
Serial.println("No BLE devices found.");
return;
}
Serial.println("BLE devices:");
for (int i = 0; i < count; i++) {
const BleScanResult* result = getBleScanResult(i);
if (!result) {
continue;
}
Serial.print(i + 1);
Serial.print(") ");
if (result->name.length() > 0) {
Serial.print(result->name);
} else {
Serial.print("(no name)");
}
Serial.print(" | ");
Serial.print(result->address);
Serial.print(" | RSSI ");
Serial.println(result->rssi);
}
Serial.println("Use: select bms <number>");
scanBleDevices(20);
return;
}
@@ -442,6 +421,7 @@ void handleDebugSerial() {
Serial.print(" / ");
Serial.println(appConfig.bms.address);
Serial.println("BMS will reconnect on next update cycle.");
exitBmsSetupMode();
return;
}