cancel
Showing results for 
Search instead for 
Did you mean: 

Use of WHITE_LIST

jampino
Associate II
Posted on November 01, 2017 at 14:00

Hello,

I am using two bluenrg-1 devices, one of them working as a slave and other working as a master. I would like to know if there is any example I can use where the white_list is used or if anyone can give me some ideas.

What I am doing now is on the central side, when the slave is advertising (ADV_IND) and the master received the hci_le_advertising_report_event() I will get the Address and type address and add the information of that device using the function aci_gap_add_devices_to_resolving_list().

Once I have added the device I will start creating the connection using the function aci_gap_start_general_connection_establish_proc().

Is that procedure correct or should I do it in a different way?

Thank you

3 REPLIES 3
jampino
Associate II
Posted on November 01, 2017 at 15:33

Hello,

When adding the device to the resolving list, I suppose the values if you want to add one device are aci_gap_add_devices_to_resolving_list( 1, WhiteList, 0 ). Inside that function, if the parameters are correct...

tBleStatus aci_gap_add_devices_to_resolving_list(uint8_t Num_of_Resolving_list_Entries,

                                                                                 Whitelist_Identity_Entry_t Whitelist_Identity_Entry[],

                                                                                 uint8_t Clear_Resolving_List)

{

struct hci_request rq;

uint8_t cmd_buffer[258];

aci_gap_add_devices_to_resolving_list_cp0 *cp0 = (aci_gap_add_devices_to_resolving_list_cp0*)(cmd_buffer);

aci_gap_add_devices_to_resolving_list_cp1 *cp1 = (aci_gap_add_devices_to_resolving_list_cp1*)(cmd_buffer + 1 + Num_of_Resolving_list_Entries * (sizeof(Whitelist_Identity_Entry_t)));

tBleStatus status = 0;

uint8_t index_input = 0;

cp0->Num_of_Resolving_list_Entries = htob(Num_of_Resolving_list_Entries, 1);

index_input += 1;

/* var_len_data input */

{

Osal_MemCpy((void *) &cp0->Whitelist_Identity_Entry, (const void *) Whitelist_Identity_Entry, Num_of_Resolving_list_Entries);    <=========== That value is one, is not copying the correct values

index_input += Num_of_Resolving_list_Entries;

{

cp1->Clear_Resolving_List = htob(Clear_Resolving_List, 1);

}

index_input += 1;

}

Can someone confirm if that is correct or not...I have seen the same on that function aci_gap_start_auto_connection_establish_proc()

Thank you

Antonio Vilei
Senior III
Posted on November 03, 2017 at 11:29

Hi Jamp,

you can find some examples about how to use the White List in the

https://my.st.com/content/my_st_com/en/products/embedded-software/wireless-connectivity-software/stsw-bnrgui.license%3d1509703776260.product%3dSTSW-BNRGUI.html

 tool for PC. It includes a set of scripts that you can run by using its built-in interpreter. Starting from the root of the tool installation folder, you could take a look at these ones:

Application\scripts\Privacy_1_2_Whitelist

Application\scripts\Security_PassKeyEntry_WhiteList

After you run the examples, you will see all the commands and events that have been generated.

These scripts are written in Python, but you can easily get inspiration from them for your own C code.

Best regards,

Antonio

Posted on November 07, 2017 at 13:20

Hello Antonio,

Thank you for your help.

I have manage to getting working following those examples but I am having a problem.

I have an slave device (bluenrg-1 stand alone) working and a master device (bluenrg-1 connected to a MCU) I follow all the steps and both connect correctly and I can find all the characteristics and publishing the changes, in that case I can see the ConnectionHandle on both devices (master and slave) are 0x0801, then I disconnect the devices using the function hci_disconnect ( ConnectionHandle, 0x13 ) I leave a second between this command and the next one but when I create the 2nd,3th....connections I can see on the slave the connectionHandle is increasing 0x0802, 0x0803... whilst on the master is always 0x0801, so when I want to discover all the services/characteristics, as I am using on the master the connectionHandle(0x0801) I can't get anything from the slave device.

Is this something that the bluenrg-1 should manage? Should I close the connection in a different way?

Thank you