[BREAKING] Replace advertised device callbacks with scan callbacks. (#389)

This replaces NimBLEAdvertisedDeviceCallbacks with NimBLEScanCallbacks and adds a onScanEnd callback.

The callback parameter for NimBLEScan::start has been removed and the blocking overload for NimBLEScan::start
has been replaced by an overload of NimBLEScan::getResults with the same parameters.
This commit is contained in:
h2zero
2022-08-27 13:13:27 -06:00
committed by h2zero
parent 562a32eda6
commit 6a2f558ea5
9 changed files with 114 additions and 130 deletions

View File

@@ -191,7 +191,7 @@ void app_main(void) {
// have detected a new device. Specify that we want active scanning and start the
// scan to run for 5 seconds.
BLEScan* pBLEScan = BLEDevice::getScan();
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setScanCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setInterval(1349);
pBLEScan->setWindow(449);
pBLEScan->setActiveScan(true);