PM_EVT_PEERS_DELETE_FAILED not raised when deleting a single peer

Hello,

I have a peripheral (nRF51822, S130, using the peer manager) that should be paired/bonded with one or many centrals. I have followed the example ble_app_bms from the sdk and I am having trouble understanding how to delete a bonding without restarting the device.

These have been my approaches:

Approach 1:

Following the ble_app_bms example and the instructions in https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.1/nrf/samples/bluetooth/peripheral_bms/README.html#testing I am:

- Bond the device

- Write 0x03 to the Bond Management Service Control Point Characteristic ( To delete the current bond). 

- Restart the device

But the bond seems to not be deleted. I expected to receive any of PM_EVT_PEERS_DELETE_SUCCEEDED or PM_EVT_PEER_DELETE_SUCCEEDED events. But It seems they are not raised anywhere.

Approach 2:

As far as I understand, the pm_peers_delete() should not be called when you are in a connected, or connectable state. So I am calling the pm_peers_delete() when a device is disconnected when in ble_evt_handler I receive the event BLE_GAP_EVT_DISCONNECTED.

And it seems to work! But only to delete all the peers... Not for a single one (pm_peer_delete(pm_peer_id_t peer_id))

Could you please help me to know how to use pm_peer_delete 

1. Where do I need to call pm_peer_delete(pm_peer_id_t peer_id);

2. Does it raise the PM_EVT_PEERS_DELETE_SUCCEEDED event when it is deleted?

Thanks.

Parents Reply Children
No Data
Related