Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeCo_1926091
Level 4
Level 4
First like received

I'm trying to clear the Bonded Devices list and WhiteList in a PSoC4 BLE application.  The API function "GapRemoveBondedDevices" says it will remove devices from both lists if "autopoplulate whitelist with bonded devices" option is enabled.  I can't find that option and one comment leads me to believe that it no longer exists.

So I guess I'll have to use that call plus "GapRemoveDeviceFromWhiteList". However, the BLE component datasheet says it's scheduled to be make obsolete (soon?).

Can anyone suggest how I should handle this?

Thanks,

Dennis

0 Likes
1 Solution

Hello,

I discussed your query with our product experts. As per the information from them, it is not recommended to use "CyBle_GapRemoveDeviceFromWhiteList()" API in your application. You should use "CyBle_GapRemoveBondedDevice()" API.

As you already mentioned "autopoplulate whitelist with bonded devices" option is not present in the latest BLE component. We will update our documentation and correct it.

Thanks and Regards,

Sudheesh

View solution in original post

0 Likes
5 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

You can use either of the functions (CyBle_GapRemoveBondedDevice or CyBle_GapRemoveDeviceFromWhiteList) to clear bonding list and white list. The function "CyBle_GapRemoveBondedDevice()" internally calls "CyBle_GapRemoveDeviceFromWhiteList()". You can refer the the example project "Day015_Bonding" available at: PSoC-4-BLE/100_Projects_in_100_Days/Day015_Bonding at master · cypresssemiconductorco/PSoC-4-BLE · G...  for a better understanding. Please feel free to ask if you have any other related queries.

Thanks and Regards,

Sudheesh

0 Likes

Thanks for your quick response, SudheeshK.

So are you saying that the information in the BLE Component's Datasheet is wrong when it says that the auto populate option must be enabled in order for CyBle_GapRemoveBondedDevice to also remove the device from the Whitelist?

If not, then how do you enable the auto populate option?

Dennis

0 Likes

Hello,

I discussed your query with our product experts. As per the information from them, it is not recommended to use "CyBle_GapRemoveDeviceFromWhiteList()" API in your application. You should use "CyBle_GapRemoveBondedDevice()" API.

As you already mentioned "autopoplulate whitelist with bonded devices" option is not present in the latest BLE component. We will update our documentation and correct it.

Thanks and Regards,

Sudheesh

0 Likes

Hi Sudheesh,

I'm not having any luck using CyBle_GapRemoveBondedDevice(). The BLE component data sheet says if device address is set to zero, then all devices will be removed.

First, if I just do CyBle_GapRemoveBondedDevice(0) it returns CYBLE_ERROR_INVALID_PARAMETER, which I suppose is true since the parameter is a pointer.

However, I'm not sure exactly what it means when it says to set the address to 0, or how to do that. I've looked into the code for that API function but, I really don't understand what it's doing to clear the bonding info.

Unfortunately, the only example I've been able to find (Day 15 of 100 projects in 100 days, called BLE-Bonding) does not use the API function you suggested. Instead it uses CyBle_GapRemoveDeviceFromWhiteList followed by CyBle_StoreBondingData "to clear the Bonding info from flash".

Can you give me instructions or an example of how to use CyBle_GapRemoveBondedDevice?

Thanks,

Dennis

Dennis E. Coburn

Coburn Engineering Co.

18 Sandy Pond Pkwy

Bedford, NH 03110

voice & text: (603) 785-4430

email: decoburn@comcast.net

0 Likes

Hello,

The API "CyBle_GapRemoveBondedDevice" expects a valid pointer a structure of type CYBLE_GAP_BD_ADDR_T as argument, 0 (NULL pointer) is an invalid argument. As  you already mentioned, this API will remove all devices from bonded list and whitelist when address passed to it is 0. Please see below code snippet for better understanding.

CYBLE_GAP_BD_ADDR_T clearAllDevices = {{0,0,0,0,0,0},0}; //Initialize the structure CYBLE_GAP_BD_ADDR_T with all 0

apiResult = CyBle_GapRemoveBondedDevice(&clearAllDevices); //pass the pointer to CYBLE_GAP_BD_ADDR_T structure as argument

It is same as how CyBle_GapRemoveDeviceFromWhiteList API is called in the Bonding example to remove devices from bonded list and white list.

Thanks and Regards,

Sudheesh

0 Likes