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.

[CC2640] Bonding Issue

Other Parts Discussed in Thread: CC2640

Hello,

I'm using CC2640 "SimpleBLEPeripheral" project to test bonding feature. Step as below..

1. setup bond manager parameter, 

  // 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);
  }

2. Use my smartphone to bond with CC2640, type in passcode "000000"

3. Bonding complete between CC2640 and peer device

4. BUT, disconnect the link each other, and doesn't connect any more. 

Do you have any idea?

  • Hi,

    Are you using the white list on the peripheral? If so, please disable.

    Also, what is the smartphone make/model & OS?

    Best wishes

  • Hi JXS,

    static void gapRole_init(void)
    { 
      // Register the current thread as an ICall dispatcher application
      // so that the application can send and receive messages.
      ICall_registerApp(&selfEntity, &sem);
      
      gapRole_state = GAPROLE_INIT;
      gapRole_ConnectionHandle = INVALID_CONNHANDLE;
      
      // Get link DB maximum number of connections
      linkDBNumConns = linkDB_NumConns();
    
      // Setup timers as one-shot timers
      Util_constructClock(&startAdvClock, gapRole_clockHandler, 
                          0, 0, false, START_ADVERTISING_EVT);
      Util_constructClock(&readRssiClock, gapRole_clockHandler, 
                          0, 0, false, RSSI_READ_EVT);
      Util_constructClock(&startUpdateClock, gapRole_clockHandler, 
                          0, 0, false, START_CONN_UPDATE_EVT);
      Util_constructClock(&updateTimeoutClock, gapRole_clockHandler,
                          0, 0, false, CONN_PARAM_TIMEOUT_EVT);
      
      // Register with GAP for HCI messages
      GAP_RegisterForHCIMsgs(selfEntity);
      
      // Initialize the Profile Advertising and Connection Parameters
      gapRole_profileRole = GAP_PROFILE_PERIPHERAL;
      VOID memset(gapRole_IRK, 0, KEYLEN);
      VOID memset(gapRole_SRK, 0, KEYLEN);
      gapRole_signCounter = 0;
      gapRole_AdvEventType = GAP_ADTYPE_ADV_IND;
      gapRole_AdvDirectType = ADDRTYPE_PUBLIC;
      gapRole_AdvChanMap = GAP_ADVCHAN_ALL;
      gapRole_AdvFilterPolicy = GAP_FILTER_POLICY_ALL;
    
      // Restore Items from NV
      VOID osal_snv_read(BLE_NVID_IRK, KEYLEN, gapRole_IRK);
      VOID osal_snv_read(BLE_NVID_CSRK, KEYLEN, gapRole_SRK);
      VOID osal_snv_read(BLE_NVID_SIGNCOUNTER, sizeof(uint32_t), 
                         &gapRole_signCounter);
    }

    Platform: Samsung Galaxy S4

    OS: Android 4.4.2

    The symptom is that can not connect to CC2640 any more, please refer to below screenshot.

  • Hello, do you have any idea about that?
  • Hi Isaac,

    Do you have a sniffer trace showing the connection attempt from the phone? What app are you using to re-connect to the device?

    Best wishes