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

Commit 88e4c017 authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/acl/btm_pm::StackAclBtmPm::btm_pm_get_power_manager_from_handle

Towards encapsulation

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host
Change-Id: Ia7ed94b87c1c75f451fea15f104380838dd04a7b
parent 7e3687d1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ struct StackAclBtmPm {
  tBTM_STATUS btm_pm_snd_md_req(uint8_t pm_id, int link_ind,
                                const tBTM_PM_PWR_MD* p_mode);
  tBTM_PM_MCB* btm_pm_get_power_manager_from_address(const RawAddress& bda);
  tBTM_PM_MCB* btm_pm_get_power_manager_from_handle(uint16_t handle);
};

namespace {
@@ -585,6 +586,13 @@ tBTM_PM_MCB* StackAclBtmPm::btm_pm_get_power_manager_from_address(
  return &(btm_cb.acl_cb_.pm_mode_db[acl_index]);
}

tBTM_PM_MCB* StackAclBtmPm::btm_pm_get_power_manager_from_handle(
    uint16_t handle) {
  int xx = btm_handle_to_acl_index(handle);
  if (xx >= MAX_L2CAP_LINKS) return nullptr;
  return &(btm_cb.acl_cb_.pm_mode_db[xx]);
}

/*******************************************************************************
 *
 * Function         btm_pm_proc_cmd_status