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

Button to enable bonding

Nrf52 SDK12.2 armgcc

I have a button on my device (peripheral) that when pressed starts a timer for 30 seconds. During that 30 seconds, I would like to have the device be in a sort of pairing mode. In the pairing mode, the device would be able to create a bond (I am using peer manager and can make a bond at any time right now). When not in pairing mode, I don't want anything to be able to bond with the peripheral. Is this possible? A point in the right direction would be appreciated!

Thanks,

Bryan

Parents
  • If you only want to let devices pair 30 seconds after the button has been pressed I think you can use pm_sec_params_set().

    When the button is pushed call pm_sec_params_set() with the security parameters you want to use when pairing/bonding, when the timer expires call pm_sec_params_set(NULL) to disallow pairing.

Reply
  • If you only want to let devices pair 30 seconds after the button has been pressed I think you can use pm_sec_params_set().

    When the button is pushed call pm_sec_params_set() with the security parameters you want to use when pairing/bonding, when the timer expires call pm_sec_params_set(NULL) to disallow pairing.

Children
  • Thank you. At device startup, I set:

    pm_sec_params_set(NULL)
    

    When Pairing button is pressed, I set the pm_sec_params_set parameters to accept bonding. After a successful bond or if timer timers out, I return to:

    pm_sec_params_set(NULL)
    

    Works great - thanks for the help!!