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.
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.
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.
Please check on BleApp_Config() which of the following functions are being called:
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
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)?