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

Implementation guidelines for Bonding and non Pairing/Bonding projects

I'm wondering about the best way to implement a bonding and also a non-bonding device. There are a lot of code parts in the SDK that show a way of implementing a BLE peripherial device, but what is the best/recommended implementation? A lot of questions around this topic come to my mind:

  1. Which code parts must be integratad in a project with bonding support?
  2. What is important for a project without pairing/bonding support?
  3. Should the device manager be used if no bonding is supported?
  4. What is important in advertising if another device is already bonded?
  5. What is important to be compatible with bonding implementations of IOS, Android and Windows Phone 8.1?

Can you recommend example projects for proper Bonding and Non-Bonding implementations? What guidelines are there for good implementation practice?

Would be great to get some recommendations from Nordic and/or other developers.

Best regards Adrian

Edit: commas between tags, format.

    1. The Device Manager handles bonding, please see this.
    2. Everything is important. There could be parts that are redundant, but it depends on your application. That said, you could investigate ble_app_beacon, which only implements advertising, no connection, and ble_app_template, which implements the battery service only.
    3. The Device Manager handles more than only the bond information, see the different contexts, but these are discarded if you don't bond. So no, not unmodified.
    4. You can just do normal advertising.
    5. The SoftDevice should do the work, but you need to handle the events from the SoftDevice, please see this.

    Use a project with the Device Manager if you need bonding, if not, use a project without.

    @Adrian: This should be changed, if the application doesn't store the bond information, it should be set to 0. It will not give an error, because the SoftDevice doesn't know if the application stores the bond information or not. Remember that you are still able to pair, and encrypt the link without doing bonding. If bonding is set to 0 the short term key (STK) is used instead of the long term key (LTK) in encryption. Master Control Panel is not a real BLE device, and it seems that it uses bond for both bonding and pairing. Hope this makes things a bit clearer. I will report it.

  • Thank you for bringing some light into this topic. I just had a look at the ble_app_template project. There is no device manager included, but in the security parameters the bond feature is enabled. How does this match together? If i change the bond feature to disabled (== 0) the device may still be bonded using the MasterControlPanel. What is the effect of this securtity parameter? I couldn't see any difference in the values 0 and 1. In coth cases can the device be bonded with Master Control Panel, even if there is no device manager involved.

Related