cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB15 whitelisting with RPA

DThom.10
Associate

Hello everyone,

I'm developping on the STM32WB15 with the wireless light stack v1.14.

I want to implement a simple IoT flow for the bonding process, it goes as follow :

  • A trigger launch the device in an open pairing mode
  • A phone connect and bond with the device
  • Later on futur advertising, I want to white list the bonded device.
  • Another trigger would allow to pair with a device not bonded

According to the release notes, the function is available in the light stack.

My implementation goes as follow :

#define CFG_BLE_ADDRESS_TYPE                0x02 /**< Bluetooth address types defined in ble_legacy.h */
     aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.ble                                         SecurityParam.bonding_mode,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
                                         CFG_SC_SUPPORT,
                                         CFG_KEYPRESS_NOTIFICATION_SUPPORT,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin,
                                         CFG_BLE_ADDRESS_TYPE
                                         );
ret = aci_gap_init(role,
                 0x02,
                 APPBLE_GAP_DEVICE_NAME_LENGTH,
                 &gap_service_handle,
                 &gap_dev_name_char_handle,
                 &gap_appearance_char_handle);

For the first adv :

ret = aci_gap_set_undirected_connectable( Min_Inter,Max_Inter,0x02,0x00);
 

For the whitelisted adv :

aci_gap_configure_whitelist();   
       ret = aci_gap_set_undirected_connectable( Min_Inter, Max_Inter,0x02,0x03);

The bonding is working and I retrieve the public address of the phone that bonded but when I try to connect with the device when white list is activated, it fails (GATT ERRO 0x85 on NRF connect application).

The example of the knowledge center is working with public address but no phone will allow that. I have previously implemented a similar behaviour on Nordic but the privacy and RPA was done under the hood.

I tried with privacy not set but the device accept all connection (like the whitelisting was not active)

If more information are required don't hesitate.

Have a wonderful day

Denis Thomas

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

In aci_gap_set_authentication_requirement function, the last parameter is the identity address type of your device, so it can be public (0x00) or static random (0x01). The management of the privacy has been improved is the last STM32CubeWB release (v1.16.0).

Best Regards