This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF Connect SDK - Only bonded/paired can connect

(nRF Connect SDK, v1.8.0, nRF52840)

I would like to create classic Bluetooth Classic peripheral behavior, the peripheral is not advertising (or advertising without name) until pairing process begin, afterwards central pairs with peripheral.

I tried to do this by using `CONFIG_BT_FILTER_ACCEPT_LIST`, but this did nothing (maybe I did something wrong?)
Afterwards, I tried this: It checks how much bonded devices are via bt_foreach_bond, if zero, it start advertising with classing BT_LE_ADV_CONN configuration.
If there is some bonded device, it starts advertising with BT_LE_ADV_OPT_CONNECTABLE|BT_LE_ADV_OPT_FILTER_CONN, and I add all bonded devices to whitelist.

This kinda works (although I have issues that on first bond when device connects and pairs, and disconnects, it will start advertise again with only BT_LE_ADV_CONN so anyone can connect again and bond, but it should be in filter enabled advertising mode), but during exploring the SDK code, I found that that all this should be handled by "CONFIG_BT_FILTER_ACCEPT_LIST" enabled. I'm doing something wrong?

EDIT: I was exploring the source code more, and I figured out that mostly CONFIG_BT_FILTER_ACCEPT_LIST is used within CAF, but there are no examples of using CAF, only some code where it is used within applications. Will be CAF example added in soon time?

EDIT2: Somehow, while exploring everything about CAF, I missed some pages, and in one page is stated example for this, it's in nrf/samples/caf, I'm quite not sure how I missed that. Anyway, the question still remains, what is the best way to do this without using CAF? Thanks

EDIT3: That CAF example only shows usage of LEDs and Buttons, nothing related to bonding or advertising

Thanks

Parents Reply Children
Related