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.

CCS/CC2640R2F: How to add a central device to a whitelist in CC2640R2 ?

Part Number: CC2640R2F

Tool/software: Code Composer Studio

    I want to imply the following feature: CC2640R2 launchpad  advertises normally and acts as a peripheral device. My iphone acts as a

central device. As long as my iphone connects with CC2640R2, it saves the address of my iphone to the whitelist and changes the

advertising mode to  White List Only. As a result ,only my iphone can connect with this CC2640R2. 

    However, I failed to add my iphone to the whitelist. HCI_LE_ReadWhiteListSizeCmd()  keeps return 0 . My code is as followed. 
1、My code is written according to this post:
https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/p/417407/1845109?tisearch=e2e-sitesearch&keymatch=cc2640%20%20whitelist#1845109

2、simple_peripheral.c

    case GAPROLE_CONNECTED:
      {

        //参数定义
        uint8 adv_filter = GAP_FILTER_POLICY_WHITE;
        uint8 remoteBdAddr[B_ADDR_LEN] = {0};
        //获取已连接的设备的地址
        GAPRole_GetParameter(GAPROLE_CONN_BD_ADDR, remoteBdAddr);
        //设置广播模式为白名单模式
        GAPRole_SetParameter( GAPROLE_ADV_FILTER_POLICY, sizeof( uint8 ), &adv_filter );
        //清空白名单
        HCI_LE_ClearWhiteListCmd();
        //将已连接的设备的地址添加到白名单中
        HCI_LE_AddWhiteListCmd( HCI_PUBLIC_DEVICE_ADDRESS, remoteBdAddr );

        ........

      }

 

3、peripheral.c

      if (events & START_ADVERTISING_EVT)
      {

        //读取白名单的大小
        uint8 WL = HCI_LE_ReadWhiteListSizeCmd();
        //whiteListNum为白名单的大小 ,whiteListNum为全局变量。
        if(WL>0 )
        {
          gapRole_AdvFilterPolicy = GAP_FILTER_POLICY_WHITE;
          whiteListNum = WL;
        }
        //whiteListNum为白名单的大小
        else
        {
          gapRole_AdvFilterPolicy = GAP_FILTER_POLICY_ALL;
          whiteListNum = 0;
        }

      .........

    }

 

4、My complete workspace can be got from here:

CCSworkspace121.rar

 

5、My code is based on the simple_peripheral project in CC2640R2 SDK -v:1.40.00.45 .  CC2640R2 SDK -v:1.40.00.45 is downloaded from here:

 

 

 

 

  • Hello,

    When connecting with peer devices that use RPAs, such as all iOS and Android 6+ central devices, you must use the Resolving List and not the White List. Refer to the LE Privacy 1.2 section in the SW User Guide: software-dl.ti.com/.../gapbondmngr.html

    Best wishes
  •     Thanks for your reply!

        I have read the soft ware develop guide for several times ,however , I failded to add my iphone to the resolving list through HCI commands ,as shown in picture 1 .

        Can you just show me the code block of using the resolving list ?

     


  • Thanks for your reply!

    I have read the soft ware develop guide for several times ,however , I failded to add my iphone to the resolving list through HCI commands ,as shown in picture 1 .

    Can you just show me the code block of using the resolving list ?