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

Bonding Information/ Whitelist

Hi all,

Is there a tutorial that explain better the bonding information and whitelist? I have more doubt about that.

My first code i have pairing and bonding:

  1. If i delete bonding information from app side, connection fail i delete information on nrf52 side, too and connection is ok
  2. I delete information on nrf52, conenction fail, i delete information bonding also on phone side and connection is ok.

After i need to add a whitelist to have a connection one to one, so i have a second release of code.

The option 1 doesn't works, the connection fails always, though i delete the information on nrf52 side.(Pairing reject)

i resolve the problem setting this flag to false:

  case PM_EVT_CONN_SEC_CONFIG_REQ:
     {
     // Reject pairing request from an already bonded peer.
     pm_conn_sec_config_t conn_sec_config = {.allow_repairing = false};
     pm_conn_sec_config_reply
   }

but i would to understand why when i have added the whitelist, i haven't problem with option 1. When i use

   uint32_t err_code ;
   err_code = pm_peers_delete();
   APP_ERROR_CHECK(err_code);

i don't delete the bonding information? How the softdevice understand that the pairing is with an already bonding device, after i delete the bonding information?

thanks, Anna

  • Hi Petter,

    the behaviour that i have is:

    1. Delete bonding information from Master side
    2. Connection fail because nrf52 reject them
    3. Delete bonding information with pm_peers_delete()
    4. Try to connect again but nrf52 fail

    It Seemed that pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true}; reolved the problem, but it's not true. It create other problem (reset device), so i want to return in the condition where allow_pairing = false.

    I'm exspect that if the nrf52 reject the pairing with the delete_peers i can connect again. and not reject again.

  • I expect that my device have a withe list = 1( so can connection only with 1 device).

    1. First case: Device and phone are connect Pairing and bonding works correctly. OK (Behavior i expect)
    2. Second case: User delete bonding information from device side. When try to connect with phone, the connection fail and device disconnect, deleting also the information on phone side all works. OK (Behavior I expect)
    3. User delete the bonding information on phone side. Device reject the pairing, ok. User delete the bonding information on device side with delete_peer. device continues to reject the pairing. I expcet that in this case, after delete the bonding information the device and phone can connect again.
  • Can you please edit your question and upload your complete project so I can test it here?

Related