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

Delete bonding after disconnect in S120

Hello,

I am working on S120 v2.1.0 and SDK 9.0 for central and I am able to connect to my iPad. Now I need the central to delete the bonding information stored using pstorage that is when I get BLE_GAP_EVT_DISCONNECTED in on_ble_evt callback function. I am using the below code snippet to delete:

case BLE_GAP_EVT_DISCONNECTED:
       err_code = dm_device_delete(&m_dm_device_handle);
       APP_ERROR_CHECK(err_code);
       break;

But I am getting the hardfault and when I debugged, the state_data_erase_swap_entry_run function where it will erase the flash is causing the hardfault.

Is this the proper way to delete peripheral bonding? Or can anyone suggest me the way to erase the bonding information?

Regards,
Sowmya

Related