[nRF52833] Retrieve Advertising RPA Address during a Connection

Hi,

I'm working on a legacy program (Peripheral) using nRF52833 and nRF5 SDK using SoftDevice S113.

In my application, when a connection is established I need to know the Resolvable address that was active when the Central connected to my peripheral.

In my peripheral I'm using a Resolvable Random Private address that rotates every 30s using pm_privacy_set();

I tried calling sd_ble_gap_adv_addr_get() on BLE_EVT_CONNECTED, but the API fails since advertising is not enabled after a connection is established (and even if it succeeded, there is a race condition between the connection being established and the event being handled during which the RPA could have rotated).
Also I don't seem to be able to find any BLE GAP events that get triggered whenever the RPA rotates (if there is such event I could keep track of the latest active address after a rotation and use that when a connection is established)
What's the recommended/preferred way for knowing the RPA that my Peripheral was using during Advertising when the Central connected?
Thanks,
Marco
Related