Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What is the right procedure to un-bond/unpair nRF52840 from host?

Hi, 

    I tried to erase the bound and start another pairing procedure without rebooting my device. I was not able to remove the bond correctly. The system hangs when I call pm_peers_delete(). The problem is right after I call this function, a PM_EVT_PEERS_DELETE_SUCCEEDED event is sent to event handler and another advertising is started. Down in ble_advertising_start(), when it calls sd_ble_gap_adv_set_configure(), the function returns NRF_ERROR_INVALID_STATE. What is the right procedure to remove the bond properly? Can I temporary shutdown BLE before erase bond and resume it after removal?

Thank you,

Min-Ching

Parents Reply
  • Hi Håkon,

         I checked all the parameter passed into sd_ble_gap_adv_set_configure. The advertising set parameter is not null. However, the data buffer pointer is the same. I don't understand why this buffer must be different when all your sample code uses BLE_ADVERTISING_DEF(m_advertising) to create a buffer and reused it. Does this mean when I call this API the device is already in advertising mode? Any other thing we can check? Do you have any good example code that I can take a look? 

    Thank you,

    Min-Ching Ho

Children
Related