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> Advertise for specified address by using white list

Other Parts Discussed in Thread: BLE-STACK

Hello, eveyone

I'm working on a secure connection,and I want to use white list to do that.

Intended purpose is only to allow the specified device can scan this device,

means that is peripheral device only advertise to specified central device.

So I search on the internet and follow this thread: ( https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/417407 )

I try to add codes in case GAPROLE_CONNECTED like the thread provide and did a little changes like

uint8 adv_filter = GAP_FILTER_POLICY_WHITE;
uint8 remoteBdAddr[B_ADDR_LEN] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};

// set the white list for advertise and scan 
GAPRole_SetParameter( GAPROLE_ADV_FILTER_POLICY, sizeof( uint8 ), &adv_filter );

HCI_LE_ClearWhiteListCmd();
HCI_LE_AddWhiteListCmd( HCI_PUBLIC_DEVICE_ADDRESS, remoteBdAddr );

This codes that I want, not to use bonding address to add to white list, it using my specified address to add.

And seems like it can advertise to 0x050403020100 address after reconnect.(My phone can't scan this peripheral device)

But I want it to advertise to this specify address when peripheral device start at the first time.

So I move these codes to SimpleBLEPeripheral_init function and set them at the bottom.

Hope it will only advertise to this address when device start up.

But when I runs it, it looks like the same as before, is somthing set up I have to change?

Or does it have other option to do that?

  • Hello,

    Please see the "5.4.5 LE Privacy 1.2" section in the BLE SW Dev Guide (SWRU393) in the BLE-Stack v2.2.0 to configure the BT4.2 Privacy 1.2 feature.

    Best wishes
  • it seems that your implementing is based on working in peripheral device.
    if yes, remoteBdAddr is not the address of your peripheral device.
    when the above address is added to the whitelist, only a central device with the specified address can initiate a connection for your peripheral device.
    that is, the whitelist is intended to filter out(kick out) any initiating for connection from any devices except for the specified device with remotedBdAddr.
    so, of course, your phone cannot scan the address.

    as reference, in central device, the whitelist is being used, some specified addresses are added to the whitelist,
    peripheral devices with only the specified addresses will be scanned by central device.

  • Hi, JXS
    Thanks for your info.
  • Hi, Ji Won
    Thanks for your suggest.
    Yes, this White list setting is works on peripheral device.
    and I think the issue may be where to setting these codes, because I set these codes after the device start function in init.
    So it looks like the same as when I set codes in case CONNECTED.
    If I set codes before start device function, then it works fine when device start up.

    But I'm wondering the central device can also set the white list?
    Because, I let central device establish the link to specified address directly, and not for scanning.
    If the central device have white list is yes, then it must through scanning mode to find is there have a specified device around, is that correct?
  • regarding "If I set codes before start device function, then it works fine when device start up.",
    before adding a specific address to the whitelist, any devices would be scanned from the phone you are using, of course.
    but, after adding is done, controller will advertise for only a central device with the specified address as you set like that.

    And regarding "I'm wondering the central device can also set the white list?", yes, whitelist is possible on both of devices.

    I think that you will need to understand the connection procedure in central point view and advertising mode in peripheral point view.

    Always, central device should have the following process.
    1. scanning starts.
    2. scanning stops.
    3. initiating starts for a connection with a peripheral device.
    4. connected.
    5. disconnected.

    Whitelist is related with scanning state in central device.
    so, if you enabled the whitelist feature and added some addresses to whitelist on Host, Controller will allow the addresses to be scanned.

    while, if the whitelist is enabled on peripheral device, central devices with the added addresses will be allowed to initiate a connection with the peripheral device.

    Ji Won

  • Hi, Ji Won

    Thank you for giving me so much information.
    I will keep understand the connection, and try adding whitelist on central.
    Thanks for the help.