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

Peer Manager Peer Delete

Hello Nordic, Im using SDK13.0 and im struggling with pm_peer_delete() My way of testing this function:

  1. Raw firmware without any bonds.
  2. Create bond. Peer id is set to 0.
  3. Over this connection try to delete different bond using pm_peer_delete(n). (n=1) Always return NRF_SUCCESS. I thnink it should return NRF_ERROR_INVALID_PARAM because there is no such bond.

I think problems is here :

 ret_code_t im_peer_free(pm_peer_id_t peer_id) {
     uint16_t   conn_handle;
     ret_code_t ret;
 
     NRF_PM_DEBUG_CHECK(m_module_initialized);
 
     conn_handle = im_conn_handle_get(peer_id);
     ret         = pdb_peer_free(peer_id);
 
     if ((conn_handle != BLE_CONN_HANDLE_INVALID) && (ret == NRF_SUCCESS))
     {
         peer_id_set(conn_handle, PM_PEER_ID_INVALID);
     }
     return ret;

}

Regards Tomek

Related