Is there a runtime counterpart for CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE?

Hi, we have a use case where the central might need to re-bond with our peripheral (e.g., after choosing "Forget this device" in phone settings). I have learned that setting CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y works for our purposes, however it would be ideal if we can configure this during runtime. Is this possible?

Here is an overview of how I envision our product to work:

  • Peripheral normally advertises with flag BT_LE_ADV_OPT_FILTER_CONN thus only allowing whitelisted centrals to connect
  • To add a new central, a button needs to be pressed on the peripheral, which sets a 60 second window where the filter accept list is disabled to allow new connections
  • Once a new connection has been established, bonding occurs and the central is added to the filter accept list

The problem with CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y is that it will always allow the central to re-bond, but our preference is for bonding to take place only after a button has been pressed on our peripheral device. Please feel free to also suggest any alternative approaches that might work better. Many thanks!

Related