This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Enable bonding for peripheral role and disable it for central role

Hi, 

I am developing an application where the device should support both central and peripheral roles at the same time. My devices are connecting to a mobile phone. All the devices should start up as peripherals and will connect to the mobile phone using a static pass key. Mobile phone will bond with the device to avoid manual pairing later. After that, mobile phone will set one of the device as a master. Then master device will act as a central and connect with other devices with that pass key but should not perform bonding.

How can i enable bonding for peripheral role and disable it for central role?

I am using SDK 16 and relay example as reference. 

Thanks

  • any guidance on how to modify the peer manager

    This sounded interesting so I had a look. It seems to me that it would be fairly simple to add this functionality. (Note that I didn't actually test this so I may have missed something)

    Search peer_manager.c for all uses of the m_evt_handlers -array. There are only two: pm_register() and evt_send().

    Both of these look like it would be easy to modify them so that the entire array is searched instead of keeping track of how many handlers have already been added (m_n_registrants). Then add a pm_deregister() function that again searches the array for a given handler and sets it to null. It seems to me that nothing more would be needed.

Related