This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

bond question with Peer Manager

I use example ble_app_hrs_pca10040_s132 with SDK12.2.0 to test bonding function.It works as a server and it is bound by client. But I fail to bond. It seems that example has peer manager and also has bond function.

So do I have to do some modification on this example to test bonding function? If yes, what should I do?

Thanks a lot!

Parents
  • It seems you are mixing up bonding with whitelisting. Even if a device has a bond with another device it can connect with other devices.

    But if you are a peripheral and advertise with a whitelist, you can put the address of a bonded peer into the whitelist, and then only accept connection requests from the specific peer.

    ble_app_hrs supports bonding, but doesn't implement whitelisting, for that you can have a look at the ble_app_hids_keyboard or ble_app_hids_mouse examples.

Reply
  • It seems you are mixing up bonding with whitelisting. Even if a device has a bond with another device it can connect with other devices.

    But if you are a peripheral and advertise with a whitelist, you can put the address of a bonded peer into the whitelist, and then only accept connection requests from the specific peer.

    ble_app_hrs supports bonding, but doesn't implement whitelisting, for that you can have a look at the ble_app_hids_keyboard or ble_app_hids_mouse examples.

Children
  • Yes,you are right.I made a mistake and ble_app_hrs supports bonding. I have tested ble_app_hids_keyboard for using whitelist.I find that this example is bond+whitelist. If bonded, the peer address will be added into whitelist. But when I disconnect, it will broadcast whitelist so that the other Ble Modules cannot connect it because it is not in the whitelist.Only the bonded one can connect it. So how can I add another BLE address into whitelist? I think BLE module address should be set into whitelist in the softdevice before advertising. Thanks a lot!

  • That is to say I want to add my ble address into whitelist and set it into softdevice without using bonding. Because when bonding, peer_id which is related to ble address will be added into whitelist_peers[].It is not 48-bit ble address. So I cannot use pm_whitelist_set(). Thanks a lot!

Related