How To Obtain Advertised Resolvable Private Address

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

cross mob
JoOr_4004241
Level 3
Level 3
25 sign-ins 10 replies posted 5 replies posted

I am using random addressing (RPA) in my BLE application on a CYW20719. In a situation where there are two or more of my devices within range of a central (e.g. CySmart v1.3 with CY5677), I have no way of determining which advertised address belongs to which device. The advertised data only includes a device name which is the same for all devices.

Is there an API call that will let me get the local random address (RPA) that is/will be advertised by my application so I can display this to the user and identify the device? The wiced_bt_dev_read_local_addr() only provides the local identity address which is not what is presented in the scan results. I could append a unique identifier like a serial number to the advertised device name but it seems that this would defeat the purpose of using random addressing.

0 Likes
1 Solution

Do you think you can generate a random number during the server startup, show this number on the server device screen and modify the device name to have the same number.  If you do not want to modify the name, you can add vendor specific data in the advertisement packet to have the same number.

View solution in original post

5 Replies
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

I am not sure if it is possible to get current BDADDR because RPA is done in the controller part of the chip and host part of the chip just may be unaware when and how the address is changed.  Meanwhile, I am trying to understand what you are trying to do.  If you need to connect to a specific device programmatically the client should be able to resolve the address. If you want to show something different for each device on the client's UI, you can modify the device name to have some random number. Regardless of the method, I still do not understand how the client will decide who to connect to if there is an address or random number in the name.

0 Likes

Victor,

Thank you for your very quick response.

I was thinking of the following scenario. There are two of my devices (servers, peripherals) and one PC with BLE (client, central). When the client on the PC scans for devices, both of my devices appear in the scan results list. Each has a random address and the device name (included in the advertisement packet). Currently, the device name is the same for all devices. So, if the client needs to connect with one specific server device, how does the client know which entry in the scan results list belongs to which server device?

If I could display the advertised random address, the user could check the server device screen and compare that displayed address with the address that appears in the scan results on the client PC. If this is not possible, I will have to provide a unique device name or some other piece of unique data in the advertisement.

Joe

0 Likes

Do you think you can generate a random number during the server startup, show this number on the server device screen and modify the device name to have the same number.  If you do not want to modify the name, you can add vendor specific data in the advertisement packet to have the same number.

Victor,

We intend to write a serial number to each device during production so I can append that (or at least the last few digits) to the device name that is advertised. This adjusted device name can then be displayed on the server device for user comparison to the scan results list on the PC client.

Thanks again for the quick responses.

Joe

0 Likes

Great. That should work. Good luck!

0 Likes