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

Commit cd477cc1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[4/24] Canonical form tBTM_STATUS::BTM_CMD_STARTED" into main

parents 3598e6c3 697c3fc0
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ static bool bta_ag_remove_sco(tBTA_AG_SCB* p_scb, bool only_active) {
    if (!only_active || p_scb->sco_idx == bta_ag_cb.sco.cur_idx) {
      tBTM_STATUS status = get_btm_client_interface().sco.BTM_RemoveSco(p_scb->sco_idx);
      log::debug("Removed SCO index:0x{:04x} status:{}", p_scb->sco_idx, btm_status_text(status));
      if (status == BTM_CMD_STARTED) {
      if (status == tBTM_STATUS::BTM_CMD_STARTED) {
        /* SCO is connected; set current control block */
        bta_ag_cb.sco.p_curr_scb = p_scb;
        return true;
@@ -553,9 +553,9 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) {
      }
    }

    if (get_btm_client_interface().sco.BTM_CreateSco(&p_scb->peer_addr, true, params.packet_types,
                                                     &p_scb->sco_idx, bta_ag_sco_conn_cback,
                                                     bta_ag_sco_disc_cback) == BTM_CMD_STARTED) {
    if (get_btm_client_interface().sco.BTM_CreateSco(
                &p_scb->peer_addr, true, params.packet_types, &p_scb->sco_idx,
                bta_ag_sco_conn_cback, bta_ag_sco_disc_cback) == tBTM_STATUS::BTM_CMD_STARTED) {
      /* Initiating the connection, set the current sco handle */
      bta_ag_cb.sco.cur_idx = p_scb->sco_idx;
      /* Configure input/output data. */
@@ -570,7 +570,7 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) {
    tBTM_STATUS btm_status = get_btm_client_interface().sco.BTM_CreateSco(
            &p_scb->peer_addr, false, params.packet_types, &p_scb->sco_idx, bta_ag_sco_conn_cback,
            bta_ag_sco_disc_cback);
    if (btm_status == BTM_CMD_STARTED) {
    if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) {
      if (get_btm_client_interface().sco.BTM_RegForEScoEvts(
                  p_scb->sco_idx, bta_ag_esco_connreq_cback) != tBTM_STATUS::BTM_SUCCESS) {
        log::warn("Unable to register for ESCO events");
+1 −1
Original line number Diff line number Diff line
@@ -1095,7 +1095,7 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
    const tBTM_STATUS status =
            get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(p_scb->PeerAddress());
    switch (status) {
      case BTM_CMD_STARTED:
      case tBTM_STATUS::BTM_CMD_STARTED:
        break;
      case BTM_MODE_UNSUPPORTED:
      case BTM_DEV_RESTRICT_LISTED:
+6 −6
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ void BTA_dm_on_hw_on() {
     the DM_ENABLE_EVT to be sent only after all the init steps are complete
     */
  if (get_btm_client_interface().local.BTM_ReadLocalDeviceNameFromController(
              bta_dm_local_name_cback) != BTM_CMD_STARTED) {
              bta_dm_local_name_cback) != tBTM_STATUS::BTM_CMD_STARTED) {
    log::warn("Unable to read local device name from controller");
  }

@@ -413,7 +413,7 @@ static void bta_dm_wait_for_acl_to_drain_cback(void* data) {
/** Sets local device name */
void bta_dm_set_dev_name(const std::vector<uint8_t>& name) {
  if (get_btm_client_interface().local.BTM_SetLocalDeviceName((const char*)name.data()) !=
      BTM_CMD_STARTED) {
      tBTM_STATUS::BTM_CMD_STARTED) {
    log::warn("Unable to set local device name");
  }
  bta_dm_set_eir((char*)name.data());
@@ -725,7 +725,7 @@ static void handle_role_change(const RawAddress& bd_addr, tHCI_ROLE new_role,
        case tBTM_STATUS::BTM_SUCCESS:
          log::debug("Role policy already set to central peer:{}", bd_addr);
          break;
        case BTM_CMD_STARTED:
        case tBTM_STATUS::BTM_CMD_STARTED:
          log::debug("Role policy started to central peer:{}", bd_addr);
          break;
        default:
@@ -1026,7 +1026,7 @@ static void bta_dm_check_av() {
          case tBTM_STATUS::BTM_SUCCESS:
            log::debug("Role policy already set to central peer:{}", p_dev->peer_bdaddr);
            break;
          case BTM_CMD_STARTED:
          case tBTM_STATUS::BTM_CMD_STARTED:
            log::debug("Role policy started to central peer:{}", p_dev->peer_bdaddr);
            break;
          default:
@@ -1180,7 +1180,7 @@ static void bta_dm_adjust_roles(bool delay_role_switch) {
                log::debug("Role policy already set to central peer:{}",
                           bta_dm_cb.device_list.peer_device[i].peer_bdaddr);
                break;
              case BTM_CMD_STARTED:
              case tBTM_STATUS::BTM_CMD_STARTED:
                log::debug("Role policy started to central peer:{}",
                           bta_dm_cb.device_list.peer_device[i].peer_bdaddr);
                break;
@@ -1700,7 +1700,7 @@ void bta_dm_ble_get_energy_info(tBTA_BLE_ENERGY_INFO_CBACK* p_energy_info_cback)
  bta_dm_cb.p_energy_info_cback = p_energy_info_cback;
  tBTM_STATUS btm_status =
          get_btm_client_interface().ble.BTM_BleGetEnergyInfo(bta_ble_energy_info_cmpl);
  if (btm_status != BTM_CMD_STARTED) {
  if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) {
    bta_ble_energy_info_cmpl(0, 0, 0, 0, HCI_ERR_UNSPECIFIED);
  }
}
+9 −6
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ static void bta_dm_search_start(tBTA_DM_API_SEARCH& search) {

  const tBTM_STATUS btm_status = BTM_StartInquiry(bta_dm_inq_results_cb, bta_dm_inq_cmpl_cb);
  switch (btm_status) {
    case BTM_CMD_STARTED:
    case tBTM_STATUS::BTM_CMD_STARTED:
      // Completion callback will be executed when controller inquiry
      // timer pops or is cancelled by the user
      break;
@@ -148,7 +148,8 @@ static void bta_dm_search_cancel() {
  /* If no Service Search going on then issue cancel remote name in case it is
     active */
  else if (!bta_dm_search_cb.name_discover_done) {
    if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) {
    if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() !=
        tBTM_STATUS::BTM_CMD_STARTED) {
      log::warn("Unable to cancel RNR");
    }
    /* bta_dm_search_cmpl is called when receiving the remote name cancel evt */
@@ -299,7 +300,7 @@ static bool bta_dm_read_remote_device_name(const RawAddress& bd_addr, tBT_TRANSP
  btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
          bta_dm_search_cb.peer_bdaddr, bta_dm_remname_cback, transport);

  if (btm_status == BTM_CMD_STARTED) {
  if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) {
    log::verbose("BTM_ReadRemoteDeviceName is started");

    return true;
@@ -434,7 +435,8 @@ static void bta_dm_search_cancel_notify() {
    case BTA_DM_SEARCH_ACTIVE:
    case BTA_DM_SEARCH_CANCELLING:
      if (!bta_dm_search_cb.name_discover_done) {
        if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) {
        if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() !=
            tBTM_STATUS::BTM_CMD_STARTED) {
          log::warn("Unable to cancel RNR");
        }
      }
@@ -708,7 +710,7 @@ static void bta_dm_start_scan(uint8_t duration_sec) {
  tBTM_STATUS status = get_btm_client_interface().ble.BTM_BleObserve(
          true, duration_sec, bta_dm_observe_results_cb, bta_dm_observe_cmpl_cb);

  if (status != BTM_CMD_STARTED) {
  if (status != tBTM_STATUS::BTM_CMD_STARTED) {
    log::warn("BTM_BleObserve  failed. status {}", status);
    if (bta_dm_search_cb.p_csis_scan_cback) {
      tBTA_DM_SEARCH data{.observe_cmpl = {.num_resps = 0}};
@@ -719,7 +721,8 @@ static void bta_dm_start_scan(uint8_t duration_sec) {

void bta_dm_ble_scan(bool start, uint8_t duration_sec) {
  if (!start) {
    if (get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL) != BTM_CMD_STARTED) {
    if (get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL) !=
        tBTM_STATUS::BTM_CMD_STARTED) {
      log::warn("Unable to start ble observe");
    }
    return;
+7 −5
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ static void bta_dm_search_start(tBTA_DM_API_SEARCH& search) {

  const tBTM_STATUS btm_status = BTM_StartInquiry(bta_dm_inq_results_cb, bta_dm_inq_cmpl_cb);
  switch (btm_status) {
    case BTM_CMD_STARTED:
    case tBTM_STATUS::BTM_CMD_STARTED:
      // Completion callback will be executed when controller inquiry
      // timer pops or is cancelled by the user
      break;
@@ -309,7 +309,8 @@ static void bta_dm_search_cancel() {
  /* If no Service Search going on then issue cancel remote name in case it is
     active */
  else if (!bta_dm_search_cb.name_discover_done) {
    if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) {
    if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() !=
        tBTM_STATUS::BTM_CMD_STARTED) {
      log::warn("Unable to cancel RNR");
    }
    /* bta_dm_search_cmpl is called when receiving the remote name cancel evt */
@@ -394,7 +395,7 @@ static bool bta_dm_read_remote_device_name(const RawAddress& bd_addr, tBT_TRANSP
  btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
          bta_dm_search_cb.peer_bdaddr, bta_dm_remname_cback, transport);

  if (btm_status == BTM_CMD_STARTED) {
  if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) {
    log::verbose("BTM_ReadRemoteDeviceName is started");

    return true;
@@ -994,7 +995,8 @@ static void bta_dm_search_cancel_notify() {
    case BTA_DM_SEARCH_ACTIVE:
    case BTA_DM_SEARCH_CANCELLING:
      if (!bta_dm_search_cb.name_discover_done) {
        if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) {
        if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() !=
            tBTM_STATUS::BTM_CMD_STARTED) {
          log::warn("Unable to cancel RNR");
        }
      }
@@ -1394,7 +1396,7 @@ static void bta_dm_service_search_remname_cback(const RawAddress& bd_addr, DEV_C
    if (btm_status == tBTM_STATUS::BTM_BUSY) {
      /* wait for next chance(notification of remote name discovery done) */
      log::verbose("BTM_ReadRemoteDeviceName is busy");
    } else if (btm_status != BTM_CMD_STARTED) {
    } else if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) {
      /* if failed to start getting remote name then continue */
      log::warn("BTM_ReadRemoteDeviceName returns 0x{:02X}", btm_status);

Loading