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

dm_device_delete_all(& m_dm_app_id); doesn't work

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?

Parents
  • Thanks for anwer. I remarked that this

    dm_device_delete_all(& m_dm_app_id);
    

    function work only when nRF51 in advertiser mode.

    When nRF51 in central mode (I use s130), this function doesn't work.

    Why?

  • 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?

Reply
  • 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?

Children
No Data
Related