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

Change static passkey after 1st bonding

In my application,the end product is given to the user with a static passkey. We need to give the user the provision to change the passkey .

Currently I have a working code with static passkey. I can bond to my device with the default password "123456 using sd_ble_opt_set. Can any one tell me, how to let the user update the passkey(while the application is running)?

  • Hi Arun,

    You would need to define your own protocol to receive the new passkey via BLE. It could be as simply as a write command. Then when you receive the command you call sd_ble_opt_set() to change the passkey.

    Note that after you bond, the next time the 2 device connect again, it won't need passkey anymore because they will automaticaly reuse the stored LTK.

Related