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

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

[5/24] Canonical form tBTM_STATUS::BTM_CMD_STORED

Prepare for class enum-ify tBTM_STATUS

Bug: 358402071
Test: m .
Flag: EXEMPT, Mechanical Refactor

Change-Id: I399910b0f3da9be9f2039e65679fdba83812cb4a
parent 7eea8e10
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -763,7 +763,7 @@ static bool bta_dm_pm_park(const RawAddress& peer_addr) {
  if (mode != BTM_PM_MD_PARK) {
    tBTM_STATUS status = get_btm_client_interface().link_policy.BTM_SetPowerMode(
            bta_dm_cb.pm_id, peer_addr, &p_bta_dm_pm_md[BTA_DM_PM_PARK_IDX]);
    if (status == BTM_CMD_STORED || status == tBTM_STATUS::BTM_CMD_STARTED) {
    if (status == tBTM_STATUS::BTM_CMD_STORED || status == tBTM_STATUS::BTM_CMD_STARTED) {
      return true;
    }
    log::warn("Unable to set park power mode");
@@ -866,7 +866,7 @@ static void bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE* p_peer_dev, uint8_t index) {
  }
  status = get_btm_client_interface().link_policy.BTM_SetPowerMode(
          bta_dm_cb.pm_id, p_peer_dev->peer_bdaddr, &pwr_md);
  if (status == BTM_CMD_STORED || status == tBTM_STATUS::BTM_CMD_STARTED) {
  if (status == tBTM_STATUS::BTM_CMD_STORED || status == tBTM_STATUS::BTM_CMD_STARTED) {
    p_peer_dev->reset_sniff_flags();
    p_peer_dev->set_sniff_command_sent();
  } else if (status == tBTM_STATUS::BTM_SUCCESS) {
@@ -980,7 +980,7 @@ void bta_dm_pm_active(const RawAddress& peer_addr) {
  tBTM_STATUS status =
          get_btm_client_interface().link_policy.BTM_SetPowerMode(bta_dm_cb.pm_id, peer_addr, &pm);
  switch (status) {
    case BTM_CMD_STORED:
    case tBTM_STATUS::BTM_CMD_STORED:
      log::debug("Active power mode stored for execution later for remote:{}", peer_addr);
      break;
    case tBTM_STATUS::BTM_CMD_STARTED:
+5 −5
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
      p_cb->state |= BTM_PM_STORED_MASK;
      log::info("Setting stored bitmask for peer:{}", remote_bda);
    }
    return BTM_CMD_STORED;
    return tBTM_STATUS::BTM_CMD_STORED;
  }

  log::info("Setting power mode for peer:{} current_mode:{}[{}] new_mode:{}[{}]", remote_bda,
@@ -272,7 +272,7 @@ bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda) {
  settings.mode = BTM_PM_MD_ACTIVE;

  switch (BTM_SetPowerMode(BTM_PM_SET_ONLY_ID, remote_bda, &settings)) {
    case BTM_CMD_STORED:
    case tBTM_STATUS::BTM_CMD_STORED:
    case tBTM_STATUS::BTM_SUCCESS:
      return true;
    default:
@@ -309,7 +309,7 @@ bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode) {
 *
 * Returns          tBTM_STATUS::BTM_SUCCESS if the HCI command is issued successful,
 *                  BTM_UNKNOWN_ADDR if bd addr is not active or bad
 *                  BTM_CMD_STORED if the command is stored
 *                  tBTM_STATUS::BTM_CMD_STORED if the command is stored
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat, uint16_t min_rmt_to,
@@ -337,7 +337,7 @@ tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat, uin
  p_cb->max_lat = max_lat;
  p_cb->min_rmt_to = min_rmt_to;
  p_cb->min_loc_to = min_loc_to;
  return BTM_CMD_STORED;
  return tBTM_STATUS::BTM_CMD_STORED;
}

/*******************************************************************************
@@ -522,7 +522,7 @@ static tBTM_STATUS btm_pm_snd_md_req(uint16_t handle, uint8_t pm_id, int link_in
    if ((mode == BTM_PM_MD_ACTIVE) ||
        ((md_res.max >= p_cb->interval) && (md_res.min <= p_cb->interval))) {
      log::debug("Storing command");
      return BTM_CMD_STORED;
      return tBTM_STATUS::BTM_CMD_STORED;
    }
    log::debug("Need to wake then sleep");
    chg_ind = true;
+1 −1
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda);
 *
 * Returns          tBTM_STATUS::BTM_SUCCESS if the HCI command is issued successful,
 *                  BTM_UNKNOWN_ADDR if bd addr is not active or bad
 *                  BTM_CMD_STORED if the command is stored
 *                  tBTM_STATUS::BTM_CMD_STORED if the command is stored
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat, uint16_t min_rmt_to,
+1 −1
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ void l2c_link_timeout(tL2C_LCB* p_lcb) {
      rc = btm_sec_disconnect(p_lcb->Handle(), HCI_ERR_PEER_USER,
                              "stack::l2cap::l2c_link::l2c_link_timeout All channels closed");

      if (rc == BTM_CMD_STORED) {
      if (rc == tBTM_STATUS::BTM_CMD_STORED) {
        /* Security Manager will take care of disconnecting, state will be
         * updated at that time */
        start_timeout = false;