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.

CC2650 Getting the GAP Bond Manger in Host Test Example to Work

Other Parts Discussed in Thread: CC2640, CC2650

I'm trying to get the GAP Bond Manger to work in the Host Test Example using SPI.

I have added gapbondmgr.h to the project which uses the functions defined in the ICallBleAPI.c

example: GAPBondMgr_SetParameter()

I added the following code in the HostTestApp_init() function to setup the GAP Bond Manger:

// Setup the GAP Bond Manager
  {
    uint32_t passkey = 0; // passkey "000000"
    uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
    uint8_t mitm = TRUE;
    uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
    uint8_t bonding = TRUE;

    GAPBondMgr_SetParameter(GAPBOND_DEFAULT_PASSCODE, sizeof(uint32_t),
                            &passkey);
    GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
    GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
    GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
    GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
  }

The CC2640 Software Developer's Guide mentions that the function callbacks for the GAP Bond Manger needs to be called after the GAP Role Profile has been started as shown below.

// Start the Device
VOID GAPRole_StartDevice(&SimpleBLEPeripheral_gapRoleCBs);

// Start Bond Manager
  VOID GAPBondMgr_Register(&simpleBLEPeripheral_BondMgrCBs);

How do I do this if the External MCU initializes the GAP Profile using the GAP Device Initialization Command (0xFE00) TI HCI commands?

Won't the TI BLE Stack handle the GAP Device Initialization Command (0xFE00) and respond back to the External MCU without notifying the Host Test application?

  • Hello. I don't think is the best way to accomplish this.  You don't need to modify the code / add anything to the project. The SDG is only describing GapBondMgr for embedded projects. For HostTest, all you need to do is add the GAP_BOND_MGR define in buildConfig.opt in the stack project (this file is described in the SDG):

    /* Include GAP Bond Manager */
     -DGAP_BOND_MGR

    You can then sendthe GapBondMgr get and set parameter commands via the HCI interface. See the HCI API guide included with the installer at: $INSTALL$\Documents

  • Thanks Tim!

    So after I receive the GAP Link Established Event (0x0605) from the CC2650 in the external MCU should I setup the GAP Bond Manger then using the HCI Gap Bond Set Parameter command (0xFE36) to set the following parameters:

    GAPBOND_DEFAULT_PASSCODE
    GAPBOND_PAIRING_MODE
    GAPBOND_MITM_PROTECTION
    GAPBOND_IO_CAPABILITIES
    GAPBOND_BONDING_ENABLED
  • No, you should configure all these upon initialization, similar to how they are all configured in the application initialization function in an embedded project.
  • Ok. So after I receive send the GAP Device Initialization (0xFE00) HCI command to the CC2650 and get a "success" status back then initialize the GAP Bond Manager parameters using the HCI commands?
  • I've set the GAP Bond Manager using the HCI commands but it still doesn't work!
    Even though pairing is enabled the CC2650 never prompts my connecting device for a passcode.

    My pairing mode is set to GAPBOND_PAIRING_MODE_WAIT_FOR_REQ and GAPBOND_MITM_PROTECTION is set to TRUE.

    I verified that build option for -DGAP_BOND_MGR is set for my TI Bluetooth stack.

  • Is the other device sending a pairing request? You also need to ensure that the two devices' I/O params match correctly for a passcode entry.
  • The other device is sending the pairing request. I was able to fix my pairing problem.
    In the Simple BLE Peripheral Profile that I added to the Host Test Example I was expecting to get pairing request when I read any of the Characteristics.
    I did not set the Attribute permissions correctly for characteristics.
    I changed them to GATT_PERMIT_AUTHEN_WRITE or GATT_PERMIT_AUTHEN_READ for each specific characteristic and that fixed my problem.

    Thanks for you help!