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

8001 bond

Hi,

I want to realize the function of bond, I use "lib_aci_bond(180/* in seconds */, 0x0050 /* advertising interval 50ms*/);'\",.When I click the connect, it can connect , but no the pair command box appear.

Something I doesn't configure??

  • Hi,

    When using the ACI Bond command, the device is in pairable/bondable mode, however the initiative to pair or bond remains with the central role device.

    In case of iOS and some other operating systems implementing Bluetooth low energy, the pairing process will start only when an error occurs on reading or writing to a Characteristic. See the Apple accessory design guidelines ( developer.apple.com/.../BluetoothDesignGuidelines.pdf) in the Section on Pairing.

    To allow the pairing to be done and the encryption to be used successfully you need to do the below steps

    1. Use ACI bond
    2. Set security level of the device in Security -> Device Security to "Security Required"
    3. On the iOS app, you now need to Read or Write to a Characteristic that is present on the nRF8001 GATT table, at this point the Pairing popup will appear on the iOS device.
    4. After pairing is successful and the link is disconnected, Read the dynamic data containing the security information using ReadDynamic data, and store it.
    5. If the nRF8001 is reset or powered off, it will lose the dynamic data containing the security information. This dynamic data can be restored using the the stored Dynamic data and the WriteDynamicData command.

    Look at the "ble_proximity_template" project in the Bluetooth low energy SDK for Arduino as a example for these steps.

  • Hi,

    I followed the procedure you describe to establish a bond with an iOS device but as soon as the popup appears after trying to read the characteristic to accept the bonding request the iOS device immediately disconnects. The popup disappears before a selection can be made. I am trying to bond with an nRF8001.

    Any I sea what he issue could be?

    Thanks,

  • Make sure that the bond on the iPhone has been deleted for the specific device (Settings -> Bluetooth -> "Device" -> Forget this device) and the Service cache flushed (turn off and turn on Bluetooth). The bond on the nRF8001 must also be deleted and should be a clean start. The issue that you see is because one of the devices has the older bond and is using it (msot likely the iPhone).

  • Thanks for the reply,

    I was able to bond with the nRF8001 device successfully using the Light Blue iOS app but still have the issue with my app. So, the nRF8001appears to be working. Will report back when I find issue with may app.

  • Problem was that iOS calls applicationWillResignActive when pairing dialog is displayed. I was disconnecting in this callback. Moving disconnect to applicationDidEnterBackground was solution.

Related