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
672 stars 138 forks source link

BLE whitelist filtering not completely working or gives error #540

Closed I-Connect closed 1 month ago

I-Connect commented 1 year ago

Hi,

As there is a lot of BT traffic I wanted to use the whitelist, so I add all my devices (a Nuki smart lock and some different enocean switches and sensors) to the whitelist

If I use setFilterPolicy(1) it works partially, I do not get an error but I only get the advertisements from the Nuki Smart lock but no advertisements from Enocean devices.

If I use setFilterPolicy(3) I get the following error: E NimBLEScan: Error initiating GAP discovery procedure; rc=530, Invalid HCI Command Parameters

(if I use setFilterPolicy(0) I get them all (and then some...) zo the sensors work)

Any ideas?

h2zero commented 1 year ago

I suspect the missing devices may be changing their address in which case the whitelist not work once the address changes.

I-Connect commented 1 year ago

I understand but would thsi be the cause of this error?

E NimBLEScan: Error initiating GAP discovery procedure; rc=530, Invalid HCI Command Parameters

h2zero commented 1 year ago

That I believe is caused by the controller. It's possible that the esp32 does not support that scan mode (3).