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.

CC2642R: Rescan after bonding

Part Number: CC2642R

Hi, 

I have a question about advertising packet after bonding.

My customer uses multi_role form the simplelink_cc13x2_26x2_sdk_5_20_00_52.

the scanning and bonding with peripheral work well at the first time.

But when he try to reconnect the central to peripheral after a disconnect event, He can't get the advertising packet.

He has the same problem as the link below.

e2e.ti.com/.../cc2640r2f-rescan-reconnection-after-bonding-succeeded-and-disconnected

  • Hi,

    After you disconnect, are you able to navigate the two button menu to connect again? Or does the device not show up in the discovered device list?

    Best Regards,

    Jan

  • Hi, 

    The device not show up in the discovered device list.

    Customer's device works as central and peripherals using multi_role. 

    His application needs secure connection and it requires a fast connection when reconnecting after bonding.

    So he implemented LE Secure connection. 

    After adding an LE secure connection to the multi_role project, the central cannot get the advertising packets of bonded device when reconnecting.

    Can I get some examples that LE secure connection is implemented?

    I attach ble configuration files.

    ti_ble_config.h

    2477.ti_ble_config.c
    /*
     *  ======== ti_ble_config.c ========
     *  Configured BLE module definitions
     *
     *  DO NOT EDIT - This file is generated by the SysConfig tool.
     */
    
    #include <bcomdef.h>
    #include <gapgattserver.h>
    #include <gap_advertiser.h>
    #include <gapbondmgr.h>
    #include "ti_ble_config.h"
    
    /*********************************************************************
     * General Role Configuration
     */
    
    // Device Name
    uint8_t attDeviceName[GAP_DEVICE_NAME_LEN]= "PROJ_A_AAAA";
    
    //Random Address
    uint8_t * pRandomAddress = NULL;
    
    /*********************************************************************
     * Bond Manager Configuration
     */
    
    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;
    uint8_t secureConnection        =    GAPBOND_SECURE_CONNECTION_ALLOW;
    uint8_t authenPairingOnly       =    false;
    uint8_t autoSyncWL              =    true;
    uint8_t eccReGenPolicy          =    0;
    uint8_t KeySize                 =    16;
    uint8_t removeLRUBond           =    true;
    uint8_t bondFailAction          =    GAPBOND_FAIL_TERMINATE_LINK;
    uint8_t KeyDistList             =    GAPBOND_KEYDIST_MENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN | GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_SIDKEY | GAPBOND_KEYDIST_SSIGN;
    uint8_t eccDebugKeys            =    false;
    uint8_t allowDebugKeys          =    true;
    uint8_t eraseBondWhileInConn    =    false;
    
    void setBondManagerParameters()
    {
        // Set Pairing Mode
        GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
        // Set MITM Protection
        GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
        // Set IO Capabilities
        GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
        // Set Bonding
        GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
        // Set Secure Connection Usage during Pairing
        GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &secureConnection);
        // Set Authenticated Pairing Only mode
        GAPBondMgr_SetParameter(GAPBOND_AUTHEN_PAIRING_ONLY, sizeof(uint8_t), &authenPairingOnly);
        // Set Auto Whitelist Sync
        GAPBondMgr_SetParameter(GAPBOND_AUTO_SYNC_WL, sizeof(uint8_t), &autoSyncWL);
        // Set ECC Key Regeneration Policy
        GAPBondMgr_SetParameter(GAPBOND_ECCKEY_REGEN_POLICY, sizeof(uint8_t), &eccReGenPolicy);
        // Set Key Size used in pairing
        GAPBondMgr_SetParameter(GAPBOND_KEYSIZE, sizeof(uint8_t), &KeySize);
        // Set LRU Bond Replacement Scheme
        GAPBondMgr_SetParameter(GAPBOND_LRU_BOND_REPLACEMENT, sizeof(uint8_t), &removeLRUBond);
        // Set Bond Fail Action
        GAPBondMgr_SetParameter(GAPBOND_BOND_FAIL_ACTION, sizeof(uint8_t), &bondFailAction);
        // Set Key Distribution list for pairing
        GAPBondMgr_SetParameter(GAPBOND_KEY_DIST_LIST, sizeof(uint8_t), &KeyDistList);
        // Set Secure Connection Debug Keys
        GAPBondMgr_SetParameter(GAPBOND_SC_HOST_DEBUG, sizeof(uint8_t), &eccDebugKeys);
        // Set Allow Debug Keys
        GAPBondMgr_SetParameter(GAPBOND_ALLOW_DEBUG_KEYS, sizeof(uint8_t), &allowDebugKeys);
        // Set the Erase bond While in Active Connection Flag
        GAPBondMgr_SetParameter(GAPBOND_ERASE_BOND_IN_CONN, sizeof(uint8_t), &eraseBondWhileInConn);
    }
    
    /*********************************************************************
     * Broadcaster Role Configuration
     */
    
    // Advertisement Params 1
    GapAdv_params_t advParams1 = {
      .eventProps =   GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_LEGACY | GAP_ADV_PROP_SCANNABLE,
      .primIntMin =   160,
      .primIntMax =   160,
      .primChanMap =  GAP_ADV_CHAN_ALL,
      .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID,
      .peerAddr =     { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
      .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,
      .txPower =      GAP_ADV_TX_POWER_NO_PREFERENCE,
      .primPhy =      GAP_ADV_PRIM_PHY_1_MBPS,
      .secPhy =       GAP_ADV_SEC_PHY_1_MBPS,
      .sid =          0
    };
    
    // Advertisement data
    uint8_t advData1[] =
    {
      0x02,
      GAP_ADTYPE_FLAGS,
      GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,
    
      0x05,
      GAP_ADTYPE_16BIT_MORE,
      // More 16-bit - UUID 0
      LO_UINT16(0xffc0),
      HI_UINT16(0xffc0),
      // More 16-bit - UUID 1
      LO_UINT16(0xfff0),
      HI_UINT16(0xfff0),
    
      0x11,
      GAP_ADTYPE_128BIT_MORE,
      // More 128-bit - UUID 0
      0xf0,
      0x00,
      0xff,
      0xc4,
      0x04,
      0x51,
      0x40,
      0x00,
      0xb0,
      0x00,
      0x00,
      0x00,
      0x00,
      0x00,
      0x00,
      0x00,
    
    
    };
    
    // Scan Response Data
    uint8_t scanResData1[] =
    {
      0x0c,
      GAP_ADTYPE_LOCAL_NAME_COMPLETE,
      'P',
      'R',
      'O',
      'J',
      '_',
      'A',
      '_',
      'A',
      'A',
      'A',
      'A',
    
      0x09,
      GAP_ADTYPE_MANUFACTURER_SPECIFIC,
      //Company Identifier
      0xff,
      0xff,
    
      //Additional Data
      0x12,
      0x34,
      0x56,
      0x78,
      0x9a,
      0xbc,
    
    
    };
    
    

  • Hi,

    Gotcha. It seems the issue lies mainly on the central/scanning side of things. To minimize the number of variables, can you try reproducing this behavior on a simple_central project? To learn how to properly implement, secure connections, then I would suggest referencing the Security Fundamentals SLA Lab which covers this information.

    Best Regards,

    Jan