h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
714 stars 150 forks source link

NimBLEExtAdvertisingCallbacks don't expose onResult like BLEExtAdvertisingCallbacks #721

Open git-78 opened 1 month ago

git-78 commented 1 month ago

Hi, I was attempting to replace the core Bluetooth lib by NimBLE which looks excellent. My code is doing BLE scan and runs fine with Espressif's Bluetooth lib. But it cannot compile with NimBLE, as it implements BLEExtAdvertisingCallbacks.onResult(esp_ble_gap_ext_adv_report_t device) - see line 146 in https://github.com/espressif/arduino-esp32/blob/master/libraries/BLE/src/BLEAdvertisedDevice.h . Yet this method doesn't exist in NimBLEExtAdvertisingCallbacks, which exposes two other methods (onScanRequest and onStopped) that BLEExtAdvertisingCallbacks does not.

Am I missing something? Can anyone help?

h2zero commented 1 month ago

The extended advertising components of this library were developed separately from the core BLE library so this is not exactly backward compatible in that area. What I think you are looking for is shown in the example here: https://github.com/h2zero/NimBLE-Arduino/blob/e2369bb380ad0fb57e8c9de94e2432a441b2a45c/examples/Bluetooth_5/NimBLE_extended_client/NimBLE_extended_client.ino#L41