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

BLE Basics: how do I lock a Peripheral to a Central (or vice versa)?

This probably falls under the category of BLE Basics, but I'm a bit slow and need some help. Here's my scenario:

I'm building a very simple BLE Peripheral that provides non-standard user inputs to a Central (in this case, an iOS device). The custom board includes an nRF51822 and a number of buttons, rotary encoders, and LEDs. I'm using the ble_nus service to send the data generated by these inputs to the Central. This is now working - when you press a button or twist a knob, the board sends the appropriate notification. All good.

In production, there may be several of these boards connected to a single Central device. We may also have several Central devices in the same space, each with several of these Peripheral boards connected. What is the best way to "lock" a Peripheral to a Central?

I want to be able to create a semi-permanent bond between the two, so that the Central always attempts to connect to the same Perhpheral(s), and so that the Peripherals don't get re-associated with a different Central if their "partner" goes off line.

I've seen other posts about "bonding" and "pairing" but those appear to have more to do with encrypting the connection. I'm not worried about that. All I want to do is make sure that board X always and only connects with iPad Y.

Any suggestions?

Thanks,

-S

  • Hi!

    This could be solved using a whitelist.

    When your peripheral is paired and bonded to you central device, it can start advertising using  a whitelist if the connection is lost.
    The whitelist is is a list of addresses which can be used to decide which centrals are allowed to establish a connection with the peripheral.

    There is a lot of Q&A's here on devzone explaining how to do this, so a quick search may help you figure out how to enable it.
    If you face any issues, be sure to let me know.

    Best regards,
    Joakim.

Related