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

How to correct use dm_device_delete_all

Hi All ! I was read many posts about this function and do not understand how to check if all data is deleted.

In my situation I do:

  1. Start advertising for bonded divices

  2. Unexpectedly in advertising state, I need create a new pairing and I call:

    • dm_device_delete_all - for deleting information about all bonded peers
    • sd_ble_gap_adv_start - start advertising whith new params.

The dm_device_delete_all return NRF_SUCCESS, but data not clear.

Is the true to check

DM_CLEAR_OPERATION_ID == p_event->event_id

in device_manager_evt_handler(...) or is there another solution ?

Thanks!!!

Parents
  • In device_manager.h, above declaration of function dm_device_delete_all is writed: "If this API returns NRF_SUCCESS, DM_EVT_DEVICE_CONTEXT_DELETED event is notified to the application for each device that is deleted from the data base"

    I simply add code:

    case DM_EVT_DEVICE_CONTEXT_DELETED:
    

    in device_manager_evt_handler(...) and hook clearing result.

    Attension: if DM "white list" is empy, that event is not occur.

Reply
  • In device_manager.h, above declaration of function dm_device_delete_all is writed: "If this API returns NRF_SUCCESS, DM_EVT_DEVICE_CONTEXT_DELETED event is notified to the application for each device that is deleted from the data base"

    I simply add code:

    case DM_EVT_DEVICE_CONTEXT_DELETED:
    

    in device_manager_evt_handler(...) and hook clearing result.

    Attension: if DM "white list" is empy, that event is not occur.

Children
Related