This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc26xx BLE Bonding Manager

Other Parts Discussed in Thread: CC2650, CC2640

Hi *,


here are two questions on Bond Manager:

Number of stored sets of bonding data

I understood for the documentation that by default the Bond Mgr can store 10 sets of bonding data in cc26xx's flash using SNV (Simple Non Volatile).
Q1: What happens if the 11th device that attempts to pair and bond?
I tried to find a document on Bond Manager on ti.com that might answer this question ...

Managing bonding data sets

As I am working on a device without keyboard and display, my assumption is that I have to use mode Just Works when pairing. Further, I'm under the impression that pairing and bonding happen in a non-interruptable way from application's perspective.

As 1st consequence, if I want to use bonding on my device, *all* central devices will be be accepted by my peripheral device, and I have to exercise care to prevent bad things happening -- as described by Aslak in http://e2e.ti.com/support/wireless_connectivity/f/538/p/337711/1178456#1178456.

As as 2nd consequence I plan to use some kind of proprietary challenge -- response authentication after pairing and bonding have happened.

According to my current understanding, it's not possible to remove one particular set of bonding data (the one from the central device that failed my proprietary authentication. Instead, it only possible to wipe away all stored bonding data sets by calling GAPBondMgr_SetParameter(GAPBOND_ERASE_ALLBONDS, 0, (void *)0); that would then call gapBondMgrEraseAllBondings();

Q2: Is my understanding correct? Or is there a more elegant way to handle the problem?

Many thanks in advance for your advise.

  • Hello. Yes, the default value is for 10 sets of bonding data to be stored. You can modify this at the tradeoff of consuming more NV space (and thus having less for application-specific use) as preprocessor defines or in gapbondmgr.h:

    #if !defined ( GAP_BONDINGS_MAX )
    #define GAP_BONDINGS_MAX 10 //!< Maximum number of bonds that can be saved in NV.
    #endif

    If an 11th device attempts to bond, bonding will fail. You can manage this by removing bonds that are no longer needed.

    You can find documentation on GAPBondMgr in the software developer's guide included with the stack.  I'm not sure which device you're using but the cc2650 software developer's guide probably explains this best. Even if you are using a cc254x, the functionality is mostly the same from the application's perspective.

    Yes, you are probably stuck using just works. The only other option is to include a passcode on the outside of the device or somehow else shipped with it. You can then proceed as if you had a display and were displaying this passcode.

    I'm not sure what you mean by pairing and bonding is non-interruptable. You can choose whether you want to pair and  / or bond and modify this choice and re-pair at any time.

    You don't have to bond (or even connect) to every device. If you know what device you want to connect to, you can prevent other devices from connecting via various methods:
       - connecting and then disconnecting if desired
       - using directed advertising
       - using a whitelist

    Your solution sounds good and is essentially the first method described above. And yes, there is a way to remove one bond. Instead of using the GAPBOND_ERASE_ALLBONDS parameter, you can use the GAPBOND_ERASE_SINGLEBOND parameter.

  • Hi Tim,


    thanks for the information provided.

    My current target processor is a cc2650, but we'll migrate to a cc2640.

    I did read the Software Developer's Guide swru393, and simultaneously looked at example code. In the sample I saw that function SimpleBLEPeripheral_init() contains several calls to GAPBondMgr_SetParameter() as well as GAPBondMgr_StartDevice(). This led me to believe that 'pairing and bonding is non-interruptable'.

    If my application can get a notification from the BLE stack after the completion of each of the steps Pairing, Authentication, Start of Encryption, Key Distribution, I can run my proprietary challenge -- response authentication right after Key Distribution has completed (and thus encrypted) and only call GAPBondMgr_StartDevice() after successful proprietary authentication.
    This will save me having to wipe away the bonding of the remote device that failed to authenticate.

    It would be great if you could comment on this once more, so I know whether I'm on the right track.

    Again, many thanks for your help.
    -- Frank

  • That is true...most of the parameters are configured in the application initialization function. But you can change these parameters at any time and also call any of the GAPBondMgr global functions as desired.
    And yes, the application gets a notification from the BLE stack after each of the steps in the GapBondMgr callback.