Load a customised IRK instead of using the default one.

qin2021
Posts: 1
Joined: Mon Apr 12, 2021 8:39 am

Load a customised IRK instead of using the default one.

Postby qin2021 » Mon Apr 12, 2021 9:00 am

Has anyone successfully load a different IRK than the default IRK when using BLE RPA?

I have two esp32 devices configured as peripherals, and because by default, the same IRK is used for both of them, after I enabled RPA, the central won't be able to tell them apart after they changed addresses.

However if I try to load a new IRK, by calling ble_hs_pvcy_set_our_irk, as suggested in here https://github.com/espressif/esp-nimble/issues/24and herehttps://github.com/apache/mynewt-nimble/issues/887,
The IRK doesn't seem to be correctly exchanged between central and peripheral - even though those 2 devices won't get confused with each other by the central, but every time when the peripheral changes address, I will have to pair and bond it again with the central, which indicates that the new address didn't get resolved by the IRK.

What I did to set the IRK is this:
in OnSync, I call ble_hs_pvcy_set_our_irk() with a new key, either generated using ble_hs_hci_util_rand(), or hardcoded, and then call ble_hs_misc_restore_irks() to reload the key.

Am I missing something here? Has anyone else managed to set a different IRK correctly?
Thanks!

Who is online

Users browsing this forum: Baidu [Spider], DrMickeyLauer and 119 guests