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

Ble pairing in nrf52832 sdk14.0.0

Hii everybody,

I want to do ble pairing(nrf 52832 development board) with android phone. after searching on nordic devzone how to pair device i found that pairing mechanism can be understood by ble_gls example given in sdk.

so I follow nordic devzone and add the static passkey method in ble_gls example like this

image description

image description

Now, when trying to pair the nrf52832 with android phone using nrf connect app, the first time is working fine and creating no problem. now disconnecting with app and connecting the same device again also create no problem.

when i unpair the device from bluetooth setting in phone and try to rebound(re-pairing) it again with same devices(nrf development board and android phone) or without any changes in code then it seems that the bonding is going on but no proper connection can not be established anymore between android phone and nrf development board and in andriod app a timeout message occur.

Disconnecting with app and connecting the same device with different android phone app again also creates same problem.

I am not able to understand what the problem is going on. can any one tell what is the problem in this code main.c and how to resolve it.

Parents
  • Hi Deepash,

    If you have a look at line 225 in your main.c you can find in PM_EVT_CONN_SEC_CONFIG_REQ event you send conn_sec_config with allow_repairing = false. This mean you tell the device not to let the phone to re-pair to your device. So either you change this option, or you erase bond information on the device so you can have a new bonding to the phone.

    This is the default behaviour because it avoid attacker to spoof that the phone losses bond information and can replace the original bond with a new bond.

  • Thanks Hung Bui for your support for the above answer. I am able to solve my one problem of repairing with the same device but unable to solve the other problem (pairing with other devices) i am not getting how to delete peer bond information of the device or to add multiple devices and storing their information im memory

Reply Children
No Data
Related