Is there a specific API to enable and disable the pairing and bonding functions of nrf52833?

Hi,

In the product I developed, there is a UI flow about the mode of pairing and binding, which has a limitation that it can only be paired and bound when entering this mode. In other modes, only those that have been paired and bound can be connected, and new devices are not allowed to connect. So I wonder if there is an API that allows me to arbitrarily enable and disable the pairing and bonding functions of the nrf52833? Ensure the integrity of the UI. I've tried using flags to limit device connections.

1.Restrict this function "smd_params_reply",error

 2.   params_req_process()

This has no effect, in fact, it can still be paired and bound normally.

3.In the main function, the pm_evt_handler() function has a limit in PM_EVT_CONN_SEC_PARAMS_REQ. The effect of the test is that Android can use nrf connect to achieve the effect of the ui process, but ios in nrf connect will keep requesting connections within the limit until it exceeds the limit The limit is until there is a connection event. In the nrf toolbox, it is more serious. After I click connect, IOS will flash back when I cancel the connection within the constraints. I have also reported this issue on github.

I have tried all the methods I know, but the actual effect is not as ideal as I imagined. So want to ask nordic to see if there are any good suggestions. Thanks!

Parents
  • Hi,

    it can only be paired and bound when entering this mode. In other modes, only those that have been paired and bound can be connected, and new devices are not allowed to connect.

    There is no direct support in the SDK for dynamically allowing or disallowing pairing/bonding. However, based on what you write, I am not sure it is needed?

    It sound like you have one of two states:

    • State A: Already bonded peers are allowed to connect.
    • State B: Any device can connect and pair/bond.

    Is this correct, and are these the only two states?

    If so, you do not need to consider allowing pairing/bonding or not, but instead need to control if any device should be able to connect (and then potentially pair/bond), or if only bonded devices should be able to connect. This is a typical scenario for bluetooth, and is normally handled using whitelisting. In state A, where only bonded peers should be allowed to connect, you advertise with whitelisting. When entering mode B, you restart advertising without whitelist, allowing anyone to connect.

    You can for instance refer to the Glucose Application for an example of the method described above. There, when there is already a bond, the device by default advertise with whitelist enabled. However with a button press, advertising without whitelist is started when any device should be allowed to connect. This is also the typical behavior you find in Bluetooth HID devices like mice, where you often have a "Connect" button or similar, or the device allows any central to connect for the first (say) 60 seconds after power-cycling.

Reply
  • Hi,

    it can only be paired and bound when entering this mode. In other modes, only those that have been paired and bound can be connected, and new devices are not allowed to connect.

    There is no direct support in the SDK for dynamically allowing or disallowing pairing/bonding. However, based on what you write, I am not sure it is needed?

    It sound like you have one of two states:

    • State A: Already bonded peers are allowed to connect.
    • State B: Any device can connect and pair/bond.

    Is this correct, and are these the only two states?

    If so, you do not need to consider allowing pairing/bonding or not, but instead need to control if any device should be able to connect (and then potentially pair/bond), or if only bonded devices should be able to connect. This is a typical scenario for bluetooth, and is normally handled using whitelisting. In state A, where only bonded peers should be allowed to connect, you advertise with whitelisting. When entering mode B, you restart advertising without whitelist, allowing anyone to connect.

    You can for instance refer to the Glucose Application for an example of the method described above. There, when there is already a bond, the device by default advertise with whitelist enabled. However with a button press, advertising without whitelist is started when any device should be allowed to connect. This is also the typical behavior you find in Bluetooth HID devices like mice, where you often have a "Connect" button or similar, or the device allows any central to connect for the first (say) 60 seconds after power-cycling.

Children
Related