How to determine the number of devices on the Whitelist?

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

cross mob
CoCo_1816446
Level 4
Level 4
25 replies posted 10 replies posted 5 replies posted

I am using CY8CKIT-062-WiFi-BT dev kit and WICED Studio 6.4 on Windows 10.

BACKGROUND:

For my project, I want

ble_advertisement_flag_value = BTM_BLE_GENERAL_DISCOVERABLE_FLAG

until there is at least one device on the Whitelist. From then on I want

ble_advertisement_flag_value = BTM_BLE_LIMITED_DISCOVERABLE_FLAG.

The first device on the Whitelist will be able to add and remove any other device from the whitelist. I have attempted the following code:

uint8_t ble_advertisement_flag_value  = BTM_BLE_GENERAL_DISCOVERABLE_FLAG|BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_CONTROLLER_SUPPORTED;

uint8_t whitelist_size  = wiced_bt_ble_get_white_list_size();

    if(whitelist_size != 0)

     {

          wiced_btm_ble_update_advertisement_filter_policy(BTM_BLE_ADVERT_FILTER_ALL_CONNECTION_REQ_WHITELIST_SCAN_REQ);

     }

It seems that wiced_bt_ble_get_white_list_size() returns the size of the chunk of memory dedicated to the whitelist. I get  whitelist_size = 128 '\200'

QUESTION:

How can I determine the number of devices on the whitelist?

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi CoCo_1816446 ,

wiced_bt_ble_get_white_list_size will give you the maximum limit of whitelist on the controller side , not the current number of devices added in whitelist.

I think you may have to manually mange a variable to track the number of devices added / removed to whitelist. There is no API as such.

Regards,

Anjana

View solution in original post

0 Likes
2 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi CoCo_1816446 ,

wiced_bt_ble_get_white_list_size will give you the maximum limit of whitelist on the controller side , not the current number of devices added in whitelist.

I think you may have to manually mange a variable to track the number of devices added / removed to whitelist. There is no API as such.

Regards,

Anjana

0 Likes

Ok, thank you.

0 Likes