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

err_code = device_instance_free(index); doesn't work

I use SDK9 s130 nRF51 in central mode. When I save 2 devices in my central, all ok. In a

m_peer_table[index].id_bitmap

i see that value 0xFF changed to 0XFC

But when I want to delete one of this bounded devices, I call function

device_instance_free(1);

and I can see in watch window that first m_peer_table[1].id_bitmap changed to 0xFF than after 1 sec this value return to 0XFC value. Therefore I can't to delete my bounded devices. Why?

Parents
  • Hi Mikhail,

    Please be noted that after you call dm_device_delete_all() it won't delete the bonded information immediately but only queue the process so the softdevice will schedule and delete it later. You would need to wait for DM_EVT_SERVICE_CONTEXT_DELETED event in the device manager event handler to know that it's deleted.

    Also please make sure you check the return code for dm_device_delete_all) if it returns NRF_SUCCESS or not.

Reply
  • Hi Mikhail,

    Please be noted that after you call dm_device_delete_all() it won't delete the bonded information immediately but only queue the process so the softdevice will schedule and delete it later. You would need to wait for DM_EVT_SERVICE_CONTEXT_DELETED event in the device manager event handler to know that it's deleted.

    Also please make sure you check the return code for dm_device_delete_all) if it returns NRF_SUCCESS or not.

Children
No Data
Related