Improve BLE scan reliability for BMS selection
This commit is contained in:
@@ -85,6 +85,9 @@ int scanBleDevices(uint32_t scanSeconds) {
|
||||
Serial.println("BLE: Disconnecting BMS before scan");
|
||||
client->disconnect();
|
||||
bmsData.connected = false;
|
||||
|
||||
Serial.println("BLE: Waiting for device advertising...");
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
bleScanResultCount = 0;
|
||||
|
||||
@@ -356,7 +356,7 @@ void handleDebugSerial() {
|
||||
}
|
||||
|
||||
if (command == "scan ble") {
|
||||
int count = scanBleDevices(10);
|
||||
int count = scanBleDevices(20);
|
||||
|
||||
if (count == 0) {
|
||||
Serial.println("No BLE devices found.");
|
||||
|
||||
Reference in New Issue
Block a user