40 sec ble scan timeout
This commit is contained in:
BIN
dist/enirodashboard.ino.bin
vendored
BIN
dist/enirodashboard.ino.bin
vendored
Binary file not shown.
@@ -1797,13 +1797,13 @@ bool startBleScan() {
|
|||||||
foundMyBleDevice = NULL;
|
foundMyBleDevice = NULL;
|
||||||
scanningDeviceIndex = 0;
|
scanningDeviceIndex = 0;
|
||||||
|
|
||||||
displayMessage(" > Scanning BLE4 devices", "5 seconds");
|
displayMessage(" > Scanning BLE4 devices", "40 seconds");
|
||||||
|
|
||||||
// Start scanning
|
// Start scanning
|
||||||
Serial.println("Scanning BLE devices...");
|
Serial.println("Scanning BLE devices...");
|
||||||
Serial.print("Looking for ");
|
Serial.print("Looking for ");
|
||||||
Serial.println(settings.obdMacAddress);
|
Serial.println(settings.obdMacAddress);
|
||||||
BLEScanResults foundDevices = pBLEScan->start(10, false);
|
BLEScanResults foundDevices = pBLEScan->start(40, false);
|
||||||
Serial.print("Devices found: ");
|
Serial.print("Devices found: ");
|
||||||
Serial.println(foundDevices.getCount());
|
Serial.println(foundDevices.getCount());
|
||||||
Serial.println("Scan done!");
|
Serial.println("Scan done!");
|
||||||
@@ -1875,7 +1875,7 @@ void setup(void) {
|
|||||||
BLEDevice::init("");
|
BLEDevice::init("");
|
||||||
|
|
||||||
// Retrieve a Scanner and set the callback we want to use to be informed when we have detected a new device.
|
// Retrieve a Scanner and set the callback we want to use to be informed when we have detected a new device.
|
||||||
// Specify that we want active scanning and start the scan to run for 5 seconds.
|
// Specify that we want active scanning and start the scan to run for 10 seconds.
|
||||||
Serial.println("Setup BLE scan");
|
Serial.println("Setup BLE scan");
|
||||||
pBLEScan = BLEDevice::getScan();
|
pBLEScan = BLEDevice::getScan();
|
||||||
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
|
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
|
||||||
|
|||||||
Reference in New Issue
Block a user