fix(nimble): Connect with OTA address for host based privacy

This commit is contained in:
Astha Verma
2026-09-18 17:20:37 +05:30
parent 7e302143db
commit c4f905e508
7 changed files with 79 additions and 9 deletions
+14 -2
View File
@@ -626,9 +626,21 @@ blecent_connect_if_interesting(void *disc)
* timeout.
*/
#if CONFIG_EXAMPLE_EXTENDED_ADV
addr = &((struct ble_gap_ext_disc_desc *)disc)->addr;
struct ble_gap_ext_disc_desc *disc_desc = disc;
#else
addr = &((struct ble_gap_disc_desc *)disc)->addr;
struct ble_gap_disc_desc *disc_desc = disc;
#endif
addr = &disc_desc->addr;
#if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
/*
* With host-based privacy, the advertising report's peer address may be
* resolved to the identity address by the Host. The Controller does not
* perform peer RPA resolution, so use the current OTA address when
* initiating the connection.
*/
addr = &disc_desc->ota_addr;
#endif
rc = ble_gap_connect(own_addr_type, addr, 30000, NULL,