NimBLE-Arduino icon indicating copy to clipboard operation
NimBLE-Arduino copied to clipboard

Whitelist only calls onResult callback for max 12 devices

Open devWaves opened this issue 3 years ago • 4 comments
trafficstars

Hi @h2zero . Me again. Once again thank you for the great work you have done with this library.

I am the primary developer of the project https://github.com/devWaves/SwitchBot-MQTT-BLE-ESP32 and it would be nowhere without your NimBLE-Arduino library

I am attempting to use whitelisting and it is successful, but the onResult callback for advertised devices is only matching on max 12 devices. I am able to add 14 devices to the whitelist (When I call NimBLEDevice::getWhiteListCount() it equals 14). But only 12 of the devices advertised data is being discovered and calling the onResult callback method

I am adding to the white list like this... (anAddr = MAC address) NimBLEDevice::whiteListAdd(NimBLEAddress(anAddr, 1));

and setting use whitelist mode like this... pScan->setFilterPolicy(BLE_HCI_SCAN_FILT_USE_WL);

thanks

devWaves avatar Jul 27 '22 07:07 devWaves

This may be a controller limitation, I'm not sure yet though. I will get back to you on this when I have a chance to look.

h2zero avatar Jul 28 '22 00:07 h2zero

Just to update this, 12 whitelist devices seems to be the hard limit for the esp32. https://github.com/espressif/esp-idf/issues/9205

h2zero avatar Jul 31 '22 19:07 h2zero

hey @h2zero thanks for looking into this. Since the issue isnt directly related to your code, feel free to close the issue. Might be good to keep open for other people to be aware though

Would be nice to have more than 12 devices in whitelist, so hopefully they make an update to the base library

devWaves avatar Aug 05 '22 20:08 devWaves

so hopefully they make an update to the base library

Doubtful to happen any time soon, it's set in the BLE controller closed source binary to this limit, in which they don't seem to keen to change parameters like this.

h2zero avatar Aug 05 '22 23:08 h2zero