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

Commit 7fc1de04 authored by Chris Manton's avatar Chris Manton
Browse files

Clean up btm_acl_update_conn_addr

Toward readable code

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

Change-Id: I9f9fb06cc11e89256c03e7a1e50e03a9a893697d
parent bd543934
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -212,8 +212,6 @@ typedef struct {
  friend void btm_acl_process_sca_cmpl_pkt(uint8_t evt_len, uint8_t* p);
  friend void btm_acl_role_changed(tHCI_STATUS hci_status,
                                   const RawAddress& bd_addr, uint8_t new_role);
  friend void btm_acl_update_conn_addr(uint16_t conn_handle,
                                       const RawAddress& address);
  friend void btm_pm_proc_cmd_status(uint8_t status);
  friend void btm_pm_proc_mode_change(uint8_t hci_status, uint16_t hci_handle,
                                      uint8_t mode, uint16_t interval);
+6 −4
Original line number Diff line number Diff line
@@ -370,11 +370,13 @@ void btm_acl_created(const RawAddress& bda, uint16_t hci_handle,
  }
}

void btm_acl_update_conn_addr(uint16_t conn_handle, const RawAddress& address) {
  uint8_t idx = btm_handle_to_acl_index(conn_handle);
  if (idx != MAX_L2CAP_LINKS) {
    btm_cb.acl_cb_.acl_db[idx].conn_addr = address;
void btm_acl_update_conn_addr(uint16_t handle, const RawAddress& address) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(handle);
  if (p_acl == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }
  p_acl->conn_addr = address;
}

/*******************************************************************************