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

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

Add stack/acl/btm_pm::BTM_SetLinkPolicyActiveMode

Bug: 175344733
Test: cert
Tag: #refactor

Change-Id: Ic3fae4495111f50dc17abe510fea395b33b91431
parent 5b832a7b
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -259,6 +259,20 @@ tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
  return internal_.btm_pm_snd_md_req(*p_acl, pm_id, acl_ind, p_mode);
}

bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda) {
  tBTM_PM_PWR_MD settings;
  memset((void*)&settings, 0, sizeof(settings));
  settings.mode = BTM_PM_MD_ACTIVE;

  switch (BTM_SetPowerMode(BTM_PM_SET_ONLY_ID, remote_bda, &settings)) {
    case BTM_CMD_STORED:
    case BTM_SUCCESS:
      return true;
    default:
      return false;
  }
}

bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode) {
  if (p_mode == nullptr) {
    LOG_ERROR("power mode is nullptr");
+1 −0
Original line number Diff line number Diff line
@@ -706,6 +706,7 @@ tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id,
 ******************************************************************************/
tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
                             const tBTM_PM_PWR_MD* p_mode);
bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda);

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