BLE Privacy Advertising Address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BLE Privacy Advertising Address

1,883 Views
michaelbrudevo1
Contributor III

I cloned the wireless UART example application and modified gAppUseBonding_d/gAppUsePairing_d/gAppUsePrivacy_d all to 1 in app_preinclude.h.  The issue I observe is that the device advertises using the public address (00:04:9F:00:00:0A), rather than the private address.  If I set gAdvParams.ownAddressType to gBleAddrTypeRandom_c in BleConnManager_GapDualRoleConfig, it uses the random address.  Is this a known issue?  The more confusing part is that documentation for ownAddressType states: "If BLE 4.2 Controller Privacy is enabled, this parameter is irrelevant as Private Resolvable Addresses are always used."

An additional related issue is that with all the settings as such, the RandomRxBdAddr is set to 1 in the advertising packet, in violation of the Bluetooth spec indicating that it is RFU and should be set to 0.

Using version 1.0.2 of the connectivity software.

Labels (2)
4 Replies

1,293 Views
albertovargas
NXP Employee
NXP Employee

Hi Michael,

Enabling the Privacy feature #define gAppUsePrivacy_d 1 means that once you perform a connection and go through the pairing/bonding procedure, a RPA will be generated using the IRK exchanged during pairing procedure. Before that, the application configures the advertisement parameters to use a random address.

1,293 Views
michaelbrudevo1
Contributor III

The confusion I'm having is that the advertisement parameters were _not_ using the random address, and the ble sniffers were detecting the public address in the advertisement packet.  I'm not focusing on the connection part, this is before all of that.

0 Kudos

1,292 Views
albertovargas
NXP Employee
NXP Employee

Please check on BleApp_Config() which of the following functions are being called:

  • void BleConnManager_GapDualRoleConfig(void);
  • void BleConnManager_GapPeripheralConfig(void);
  • void BleConnManager_GapCentralConfig(void);

Once you identify the function, go to it and take a look to the following code:

//Code from BleConnManager_GapDualRoleConfig

#if gAppUsePrivacy_d
gAdvParams.peerAddressType = gBleAddrTypeRandom_c;
gScanParams.ownAddressType = gBleAddrTypeRandom_c;
#endif

As you can see, if privacy is enabled this will modify the scanning/advertisement paramenters. If you want to set the advertisement address as random, add the following line

//Code from BleConnManager_GapDualRoleConfig

#if gAppUsePrivacy_d
gAdvParams.peerAddressType = gBleAddrTypeRandom_c;

gAdvParams.ownAddressType = gBleAddrTypeRandom_c;
gScanParams.ownAddressType = gBleAddrTypeRandom_c;
#endif

0 Kudos

1,293 Views
michaelbrudevo1
Contributor III

Yes, I proposed exactly that solution in my original post.  The reason for my post is I'm wondering why that is not the default configuration?  Shouldn't users who enable privacy want to actually use it (e.g., advertise using the random address)?

0 Kudos