5050#define BTM_BLE_META_READ_IRK_LEN 2
5151#define BTM_BLE_META_ADD_WL_ATTR_LEN 9
5252
53+ #if CONTROLLER_RPA_LIST_ENABLE && BLE_SMP_ID_RESET_ENABLE
54+ static bool is_deleting_zero_addr ;
55+ #endif // CONTROLLER_RPA_LIST_ENABLE && BLE_SMP_ID_RESET_ENABLE
5356/*******************************************************************************
5457** Functions implemented controller based privacy using Resolving List
5558*******************************************************************************/
@@ -343,8 +346,21 @@ void btm_ble_remove_resolving_list_entry_complete(UINT8 *p, UINT16 evt_len)
343346 btm_cb .ble_ctr_cb .resolving_list_avail_size ++ ;
344347 }
345348 } else {
346- BTM_TRACE_ERROR ("%s remove resolving list error 0x%x" , __func__ , status );
349+ #if CONTROLLER_RPA_LIST_ENABLE && BLE_SMP_ID_RESET_ENABLE
350+ if (!is_deleting_zero_addr )
351+ #endif // CONTROLLER_RPA_LIST_ENABLE && BLE_SMP_ID_RESET_ENABLE
352+ {
353+ /* It's expected for some controllers to return error when deleting {0,0,0,0,0,0}, ignore that case */
354+ BTM_TRACE_ERROR ("%s remove resolving list error, status = 0x%02x" , __func__ , status );
355+ }
356+ }
357+
358+ #if CONTROLLER_RPA_LIST_ENABLE && BLE_SMP_ID_RESET_ENABLE
359+ /* Clear zero address deletion flag regardless of outcome */
360+ if (is_deleting_zero_addr ) {
361+ is_deleting_zero_addr = false;
347362 }
363+ #endif // CONTROLLER_RPA_LIST_ENABLE && BLE_SMP_ID_RESET_ENABLE
348364}
349365
350366/*******************************************************************************
@@ -1139,6 +1155,7 @@ void btm_ble_resolving_list_cleanup(void)
11391155
11401156}
11411157
1158+ #if (CONTROLLER_RPA_LIST_ENABLE == TRUE )
11421159void btm_ble_add_default_entry_to_resolving_list (void )
11431160{
11441161 /*
@@ -1151,9 +1168,17 @@ void btm_ble_add_default_entry_to_resolving_list(void)
11511168 BD_ADDR peer_addr = {0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 };
11521169 BT_OCTET16 peer_irk = {0x0 };
11531170
1171+ #if (BLE_SMP_ID_RESET_ENABLE == TRUE )
11541172 // Remove the existing entry in resolving list When resetting the device identity
11551173 btsnd_hcic_ble_rm_device_resolving_list (BLE_ADDR_PUBLIC , peer_addr );
11561174
1175+ is_deleting_zero_addr = true;
1176+
1177+ btm_ble_enq_resolving_list_pending (peer_addr , BTM_BLE_META_REMOVE_IRK_ENTRY );
1178+ #endif // (BLE_SMP_ID_RESET_ENABLE == TRUE)
11571179 btsnd_hcic_ble_add_device_resolving_list (BLE_ADDR_PUBLIC , peer_addr , peer_irk , btm_cb .devcb .id_keys .irk );
1180+
1181+ btm_ble_enq_resolving_list_pending (peer_addr , BTM_BLE_META_ADD_IRK_ENTRY );
11581182}
1183+ #endif // (CONTROLLER_RPA_LIST_ENABLE == TRUE)
11591184#endif
0 commit comments