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

Option to disable Peer Manager

Hello, 

We are making device using NRF52832 and SDK 16.0 .

In our solution we required to pair and bond , between phone and device and hence we are using the peer manager in device firmware.

How ever in the same solution there are instant when device want to expose different service to phone , and don't need pairing and bonding , during that connection with phone.

To do so, when device, disconnect from the phone during bonded connection, it disables the softdevice and reinitialize it with new service. however there is no way to disable the peer manager.

Hence, when phone try to connect with device, peer manager check for bonding and it is not working. 

Please let us know, is there way to disable the peer manager, after it is initialized once, without power cycling or restart the device?

 

Regards,

khodidas 

  • Hi khodidas,

    The peer manager does not support uninitializing. A simple hack could be to add a variable called e.g. m_paused in peer_manager.c, and a function that sets it to true ore false. Then you could check that in ble_evt_handler() in peer_manager.c, and return immediately if false. If you also make sure to not make any peer manager calls from your application while paused, this should do the trick. (I have not tested this though, so there may be some pitfalls I am not seeing at the moment.)

    Einar

Related