I use SDK9 nRF51. I use white list. When I want to delete all bounded devices, I call this function. But it doesn't work. It not deleted. Why I can't to delete bounded devices?
I use SDK9 nRF51. I use white list. When I want to delete all bounded devices, I call this function. But it doesn't work. It not deleted. Why I can't to delete bounded devices?
in my code I don't use
static uint32_t device_manager_evt_handler(dm_handle_t const * p_handle,
dm_event_t const * p_event,
ret_code_t event_result)
{ uint32_t err_code;
static bool device_delete_all_started;
// Recovery in the event of DM_DEVICE_CONTEXT_FULL
if(event_result == DM_DEVICE_CONTEXT_FULL)
{
/* Clear all devices from the bond table*/
err_code = dm_device_delete_all(&m_app_handle);
APP_ERROR_CHECK(err_code);
device_delete_all_started = true;
}
if (p_event->event_id ==DM_EVT_DEVICE_CONTEXT_DELETED)
{
/* Wait for all devices to be cleared before perfoming a sys reset */
if(device_delete_all_started && (p_handle->device_id == DEVICE_MANAGER_MAX_BONDS -1))
{
err_code = sd_nvic_SystemReset();
APP_ERROR_CHECK(err_code);
}
}
in
device_manager_evt_handler
may be is it problem here?
or if I call
dm_device_delete_all_disconnected(& m_dm_app_id);
from my code I just should wait
DM_EVT_DEVICE_CONTEXT_DELETED
?
I added your code into
device_manager_evt_handler
and without any success. When I call
dm_device_delete_all(& m_dm_app_id);
bounded devices erased. But when I reset nrf51, I again can see 2 my bounded devices. ?
Please check whether you are getting any DM_EVT_DEVICE_CONTEXT_DELETED in your DM callback after calling dm_device_delete_all().