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

Unbonded event to peripheral

Hello,

I am working on nRF51822 S110 softdevice 8.0 and SDK9.0. I am creating paired and unpaired states and the system will goto unpaired only if it is unpaired from the central.

I need to know, can softdevice give the unbonded event after disconnection? or connection has to be there to send unbonded event? And I also want to know the event for unbonded? what does BLE_BONDMNGR_EVT_CONN_TO_BONDED_CENTRAL indicates?

Regards, Sowmya

  • The BLE_BONDMNGR_EVT_CONN_TO_BONDED_CENTRAL event doesn't exist is SDK 9.0.0. This is an event from the Bond Manager, which was replaced by the Device Manager some SDK versions ago. What do you mean by unpaired? Do you mean that you have been paired and then you unpair? Or that you simply haven't paired? Bonding is handled by the application so the SoftDevice will not send such an event. Could you explain a bit more about your system?

  • Hello Petter, First the device will get connected, paired(bonded) and service enabled. Later if central disconnects, the stack will send disconnect event. But still the bonding will be existing in both peripheral and central. Now if central unpaires(unbond), will the stack sends any events to the application in peripheral?

  • Maybe I'm misunderstanding you, but if the peripheral and central are disconnected, they are not connected, there is no commincation between them, so the central can't tell the peripheral that it has deleted it's bond.

    There are ways of checking if the central has deleted the bond, but then you need to reconnect first.

    Then you have two scenarioes.

    That the central initiates the procedures. The central can do this whenever it wants, or when it does service discovery and tries to read an characteristic value or descriptor that requires encryption. If the central has a bond it will send an encryption request, and the peripheral application will receive the BLE_GAP_EVT_SEC_INFO_REQUEST event, see this for more information. If the central doesn't have a bond it will send an pairing request, and the peripheral application will receive the BLE_GAP_EVT_SEC_PARAMS_REQUEST event, see this for more information. If BLE_GAP_EVT_SEC_PARAMS_REQUEST is received the peripheral can check its list of bonded devices and delete the appropriate bond.

    The second is that the peripheral initiates the procedures. It can call sd_ble_gap_authenticate() and then you get into the same situation as above, and then you can take the appropriate action depending if you receive BLE_GAP_EVT_SEC_INFO_REQUEST or BLE_GAP_EVT_SEC_PARAMS_REQUEST.

Related