Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebc1761f authored by Chris Manton's avatar Chris Manton
Browse files

Move btm_acl.cc::btm_ble_refresh_local_resolvable_private_addr

From: stack/btm/btm_ble_addr.cc
Into: stack/acl/btm_acl.cc

Working towards encapsulation of tACL_CONN

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: I6c40030347a897635218cf831d5fd5a5fcf7707e
parent 8b657ce7
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -2563,3 +2563,31 @@ int btm_pm_find_acl_ind(const RawAddress& remote_bda) {
  }
  return xx;
}

/*******************************************************************************
 *
 * Function         btm_ble_refresh_local_resolvable_private_addr
 *
 * Description      This function refresh the currently used resolvable private
 *                  address for the active link to the remote device
 *
 ******************************************************************************/
void btm_ble_refresh_local_resolvable_private_addr(
    const RawAddress& pseudo_addr, const RawAddress& local_rpa) {
#if (BLE_PRIVACY_SPT == TRUE)
  tACL_CONN* p = btm_bda_to_acl(pseudo_addr, BT_TRANSPORT_LE);

  if (p != NULL) {
    if (btm_cb.ble_ctr_cb.privacy_mode != BTM_PRIVACY_NONE) {
      p->conn_addr_type = BLE_ADDR_RANDOM;
      if (!local_rpa.IsEmpty())
        p->conn_addr = local_rpa;
      else
        p->conn_addr = btm_cb.ble_ctr_cb.addr_mgnt_cb.private_addr;
    } else {
      p->conn_addr_type = BLE_ADDR_PUBLIC;
      p->conn_addr = *controller_get_interface()->get_address();
    }
  }
#endif
}
+0 −27
Original line number Diff line number Diff line
@@ -346,30 +346,3 @@ void btm_ble_refresh_peer_resolvable_private_addr(const RawAddress& pseudo_bda,
#endif
}
/*******************************************************************************
 *
 * Function         btm_ble_refresh_local_resolvable_private_addr
 *
 * Description      This function refresh the currently used resolvable private
 *                  address for the active link to the remote device
 *
 ******************************************************************************/
void btm_ble_refresh_local_resolvable_private_addr(
    const RawAddress& pseudo_addr, const RawAddress& local_rpa) {
#if (BLE_PRIVACY_SPT == TRUE)
  tACL_CONN* p = btm_bda_to_acl(pseudo_addr, BT_TRANSPORT_LE);

  if (p != NULL) {
    if (btm_cb.ble_ctr_cb.privacy_mode != BTM_PRIVACY_NONE) {
      p->conn_addr_type = BLE_ADDR_RANDOM;
      if (!local_rpa.IsEmpty())
        p->conn_addr = local_rpa;
      else
        p->conn_addr = btm_cb.ble_ctr_cb.addr_mgnt_cb.private_addr;
    } else {
      p->conn_addr_type = BLE_ADDR_PUBLIC;
      p->conn_addr = *controller_get_interface()->get_address();
    }
  }
#endif
}
+0 −2
Original line number Diff line number Diff line
@@ -146,8 +146,6 @@ extern bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo,
                                               uint8_t* p_identity_addr_type);
extern void btm_ble_refresh_peer_resolvable_private_addr(
    const RawAddress& pseudo_bda, const RawAddress& rra, uint8_t rra_type);
extern void btm_ble_refresh_local_resolvable_private_addr(
    const RawAddress& pseudo_addr, const RawAddress& local_rpa);
extern void btm_ble_read_resolving_list_entry_complete(uint8_t* p,
                                                       uint16_t evt_len);
extern void btm_ble_remove_resolving_list_entry_complete(uint8_t* p,
+2 −0
Original line number Diff line number Diff line
@@ -274,3 +274,5 @@ int btm_pm_find_acl_ind(const RawAddress& remote_bda);

void btm_cont_rswitch(tACL_CONN* p, tBTM_SEC_DEV_REC* p_dev_rec,
                      uint8_t hci_status);
void btm_ble_refresh_local_resolvable_private_addr(
    const RawAddress& pseudo_addr, const RawAddress& local_rpa);