Best Practice of Using the Whitelist in nRF5340

Hi, 

I am using nRF5340 Audio DK. I have 3 kits currently and I have programmed one as a headset and the other two as gateways.

I would like to use the whitelist so that I can enter one of the gateways MAC address into the whitelist manually (because I can view the gateways public MAC address). My goal is to be able to be iterating between these gateways addresses to shift the connection from one gateway to the other from the headset - so both addresses will be kind of pre-configured in the headset and let's say when pressing a button the headset shift the connection from gateway 1 to gateway 2, and vice versa. After reading lots of articles, I have been advised to use the whitelist to be able to achieve this behavior.

My questions are:

(1) Where can I put the function API bt_le_whitelist_add()? Is there any best practice to use it so that no fatal error could happen later on? Also, is there a code example which I can refer to to see how the whitelist is implemented? - as I am new to this development...

 

(2) How can I pass the public MAC addresses of the gateway we intend to connect to manually as a parameter into that function? Because the function does not accept strings, it only accepts bt_addr_le_t type. What is your thoughts on this?

Thank you for your assistance in advance

Parents Reply Children
Related