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.

CC2541: Issue with GAP_BONDINGS_MAX in cc2541

Part Number: CC2541

Hi,

I am using cc2541. Our customers are facing issues when they tried to pair more than 10 devices.


1- What max value I can set GAP_BONDINGS_MAX?
2- How can I delete the first device in case of a full bonded list?
3- How can I automatically enable erase of all bonds in case of a full bonded list?
4- Is there a proper solution(example code) to handle such a case?

Kindly suggest a solution. It's really urgent for us.

Thanks

  • Hi Muqarrab,

    1. The max amount of devices is set to 10 by default in gapbondmgr.h. This can be modified as needed by the application. However, I would take precautions as there may be changes needed to support the storage of larger number of bonds. Please refer to the section Increasing Number of Bonding Entries for more details on what changes are required to support storage of a larger number of bonds.

    2. There is a "least recently used" scheme that you can enable. Please refer to the section GAPBondMgr and SNV for more information on this scheme.

    3. If the bond list is full, you can use the GAPBondMgr_SetParameter along with the GAPBOND_ERASE_ALLBONDS (0x409) macro detailed on the following the TI BLE-Stack API Documentation for GAP Bond Manager Parameters page. If doing this, I would ensure that when attempting to erase all bonds, ensure that there are no active BLE connections as this can result in an error.

    4. I don't believe the OOB example code shows deleting all bonds or deletes recently used bonds. However, I would refer to the documentation as they should cover the use case.

    Best Regards,

    Jenny

  • Thanks, Jenny

    I am trying to implement this "least recently used" but not getting how to set this parameter GAPBOND_LRU_BOND_REPLACEMENT true. I have not found this parameter. Can you please guide how I can set this parameter? 

    Thanks again

  • Hi,

    What is your SDK version? If you use CC2541, you can use "GAPBondMgr_SetParameter(GAPBOND_ERASE_SINGLEBOND, len, pValue)" to delete single bond

  • Hi,
    Is there a way to delete all devices bonded except current device connected?

  • Hi Muqarrab,

    You are correct, I apologize, GAPBOND_LRU_BOND_REPLACEMENT is not available on CC2541. I agree with Kimi that GAPBOND_ERASE_SINGLEBOND  is the best solution for the case you are describing.

    In your case of deleting all devices bonded except the current connected device, you can iterate through the bond table and call GAPBondMgr_SetParameter with the GAPBOND_ERASE_SINGLEBOND to erase old bonds. Navigate to the function GAPBondMgr_SetParameter within the file gapbondmgr.c to see how the GAPBOND_ERASE_SINGLEBOND handles erasing a bond.

    Best Regards,

    Jenny