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.

CC2650EM-7ID-RD: GAPBOND_SECURE_CONNECTION seems to be ignored

Part Number: CC2650EM-7ID-RD
Other Parts Discussed in Thread: CC2650

Hello,

I'm trying to modify the "simple_peripheral_cc2650em_app" example to use secure connections using numeric comparison. I want to connect via an iOS and Android device.

Therefore I'm configuring the GAPBondMgr like this.

uint8_t scMode = GAPBOND_SECURE_CONNECTION_ONLY;
uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8_t mitm = TRUE;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_YES_NO;

GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &scMode);

Unfortunately when trying to connect the iOS/Android device still shows a Passcode Entry form, which should not happen when using the combination of Secure Connection, Display+Keyboard (Smartphone) and Display+YES/NO (CC2650). Instead it should be showing the numeric comparison form.


My passcodeCB is always called with numComparison == 0

static void SimplePeripheral_passcodeCb(uint8_t *deviceAddr, uint16_t connHandle, uint8_t uiInputs, uint8_t uiOutputs, uint32_t numComparison)
{
  gapPasskeyNeededEvent_t *pData;

  // Allocate space for the passcode event.
  if ((pData = ICall_malloc(sizeof(gapPasskeyNeededEvent_t))))
  {
    memcpy(pData->deviceAddr, deviceAddr, B_ADDR_LEN);
    pData->connectionHandle = connHandle;
    pData->numComparison = numComparison;
    Display_print1(dispHandle, 1, 0, "numcomp: %d", numComparison);

    // Enqueue the event.
    SimpleBLEPeripheral_enqueueMsg(SBP_PASSWORD_NEEDED_EVT, uiOutputs, (uint8_t *)pData);
  }
}

Am I missing something?


  • In the stack side, did you enable secure connection feature?

    It's in the stack project under Tools folder, file name: build_config.opt
    make sure -DBLE_V42_FEATURES=SECURE_CONNS_CFG is not commented out.
  • Ahhh thank you! That's probably it :-)

    //edit:

    Yep after uncommenting that and changing the app_ble.cf to this, everything is working as expected! Thanks again!

    utils.importFile("../../../../../src/common/cc26xx/kernel/cc2640/config/cc2640.cfg");
    /*
    * Extend the cc2640 configuration
    */
    var Memory = xdc.useModule('xdc.runtime.Memory');
    var HEAPMGR_CONFIG = 1;
    var HEAPMGR_SIZE   = 4500;