summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Manton <cmanton@google.com> 2024-07-05 10:52:40 -0700
committer Chris Manton <cmanton@google.com> 2024-08-13 17:58:37 -0700
commit697c3fc0535360c9e22ac93c334e9877a16ed007 (patch)
tree769ef9a957c6ce197ff5e81b4f1a52eadf623cb0
parentfe7bf877ec1b4cc4df98baaf83735936c54022ac (diff)
[4/24] Canonical form tBTM_STATUS::BTM_CMD_STARTED
Prepare for class enum-ify tBTM_STATUS Bug: 358402071 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ifae45f7ff698e07e03086d9ee6fb0e5f9dafe887
-rw-r--r--system/bta/ag/bta_ag_sco.cc10
-rw-r--r--system/bta/av/bta_av_main.cc2
-rw-r--r--system/bta/dm/bta_dm_act.cc12
-rw-r--r--system/bta/dm/bta_dm_device_search.cc15
-rw-r--r--system/bta/dm/bta_dm_disc_legacy.cc12
-rw-r--r--system/bta/dm/bta_dm_pm.cc6
-rw-r--r--system/bta/dm/bta_dm_sec.cc30
-rw-r--r--system/bta/hearing_aid/hearing_aid.cc2
-rw-r--r--system/bta/hf_client/bta_hf_client_sco.cc4
-rw-r--r--system/bta/test/bta_ag_test.cc4
-rw-r--r--system/bta/test/bta_dm_test.cc2
-rw-r--r--system/bta/test/bta_sec_test.cc14
-rw-r--r--system/bta/test/bta_test_fixtures.h2
-rw-r--r--system/btif/src/btif_a2dp_source.cc6
-rw-r--r--system/btif/src/btif_sock_sco.cc2
-rw-r--r--system/stack/acl/btm_acl.cc18
-rw-r--r--system/stack/acl/btm_pm.cc2
-rw-r--r--system/stack/btm/btm_ble_cont_energy.cc2
-rw-r--r--system/stack/btm/btm_ble_gap.cc12
-rw-r--r--system/stack/btm/btm_ble_privacy.cc2
-rw-r--r--system/stack/btm/btm_ble_sec.cc6
-rw-r--r--system/stack/btm/btm_devctl.cc6
-rw-r--r--system/stack/btm/btm_inq.cc6
-rw-r--r--system/stack/btm/btm_sco.cc20
-rw-r--r--system/stack/btm/btm_sec.cc93
-rw-r--r--system/stack/btm/btm_sec.h2
-rw-r--r--system/stack/gatt/gatt_auth.cc3
-rw-r--r--system/stack/include/acl_api.h10
-rw-r--r--system/stack/include/btm_api.h14
-rw-r--r--system/stack/include/btm_inq.h2
-rw-r--r--system/stack/include/l2cap_security_interface.h2
-rw-r--r--system/stack/l2cap/l2c_csm.cc4
-rw-r--r--system/stack/l2cap/l2c_link.cc4
-rw-r--r--system/stack/l2cap/l2c_utils.cc4
-rw-r--r--system/stack/rnr/remote_name_request.cc14
-rw-r--r--system/stack/rnr/remote_name_request.h4
-rw-r--r--system/stack/smp/smp_act.cc2
-rw-r--r--system/stack/test/btm/stack_btm_inq_test.cc2
-rw-r--r--system/test/headless/mode/mode.cc4
-rw-r--r--system/test/headless/read/name.cc2
40 files changed, 186 insertions, 177 deletions
diff --git a/system/bta/ag/bta_ag_sco.cc b/system/bta/ag/bta_ag_sco.cc
index 253c5f170e..948e325ce7 100644
--- a/system/bta/ag/bta_ag_sco.cc
+++ b/system/bta/ag/bta_ag_sco.cc
@@ -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");
diff --git a/system/bta/av/bta_av_main.cc b/system/bta/av/bta_av_main.cc
index 6b8bd2827c..443011d9e1 100644
--- a/system/bta/av/bta_av_main.cc
+++ b/system/bta/av/bta_av_main.cc
@@ -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:
diff --git a/system/bta/dm/bta_dm_act.cc b/system/bta/dm/bta_dm_act.cc
index 9f9abcc7c7..15361f3fbc 100644
--- a/system/bta/dm/bta_dm_act.cc
+++ b/system/bta/dm/bta_dm_act.cc
@@ -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);
}
}
diff --git a/system/bta/dm/bta_dm_device_search.cc b/system/bta/dm/bta_dm_device_search.cc
index 88e0bc6a8c..a8e1a16092 100644
--- a/system/bta/dm/bta_dm_device_search.cc
+++ b/system/bta/dm/bta_dm_device_search.cc
@@ -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;
diff --git a/system/bta/dm/bta_dm_disc_legacy.cc b/system/bta/dm/bta_dm_disc_legacy.cc
index 86899c8d18..f1aa6b09a5 100644
--- a/system/bta/dm/bta_dm_disc_legacy.cc
+++ b/system/bta/dm/bta_dm_disc_legacy.cc
@@ -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);
diff --git a/system/bta/dm/bta_dm_pm.cc b/system/bta/dm/bta_dm_pm.cc
index 487785da13..d43a141dd4 100644
--- a/system/bta/dm/bta_dm_pm.cc
+++ b/system/bta/dm/bta_dm_pm.cc
@@ -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 == BTM_CMD_STARTED) {
+ if (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 == BTM_CMD_STARTED) {
+ if (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) {
@@ -983,7 +983,7 @@ void bta_dm_pm_active(const RawAddress& peer_addr) {
case BTM_CMD_STORED:
log::debug("Active power mode stored for execution later for remote:{}", peer_addr);
break;
- case BTM_CMD_STARTED:
+ case tBTM_STATUS::BTM_CMD_STARTED:
log::debug("Active power mode started for remote:{}", peer_addr);
break;
case tBTM_STATUS::BTM_SUCCESS:
diff --git a/system/bta/dm/bta_dm_sec.cc b/system/bta/dm/bta_dm_sec.cc
index 2c810f0161..1f6b150afe 100644
--- a/system/bta/dm/bta_dm_sec.cc
+++ b/system/bta/dm/bta_dm_sec.cc
@@ -125,7 +125,7 @@ void bta_dm_bond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_TRANSP
tBTM_STATUS status = get_btm_client_interface().security.BTM_SecBond(bd_addr, addr_type,
transport, device_type);
- if (bta_dm_sec_cb.p_sec_cback && (status != BTM_CMD_STARTED)) {
+ if (bta_dm_sec_cb.p_sec_cback && (status != tBTM_STATUS::BTM_CMD_STARTED)) {
memset(&sec_event, 0, sizeof(tBTA_DM_SEC));
sec_event.auth_cmpl.bd_addr = bd_addr;
bd_name_from_char_pointer(sec_event.auth_cmpl.bd_name,
@@ -156,7 +156,7 @@ void bta_dm_bond_cancel(const RawAddress& bd_addr) {
status = get_btm_client_interface().security.BTM_SecBondCancel(bd_addr);
if (bta_dm_sec_cb.p_sec_cback &&
- (status != BTM_CMD_STARTED && status != tBTM_STATUS::BTM_SUCCESS)) {
+ (status != tBTM_STATUS::BTM_CMD_STARTED && status != tBTM_STATUS::BTM_SUCCESS)) {
sec_event.bond_cancel_cmpl.result = BTA_FAILURE;
bta_dm_sec_cb.p_sec_cback(BTA_DM_BOND_CANCEL_CMPL_EVT, &sec_event);
@@ -263,9 +263,10 @@ static tBTM_STATUS bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_cla
bta_dm_sec_cb.pin_evt = BTA_DM_PIN_REQ_EVT;
bta_dm_sec_cb.pin_bd_addr = bd_addr;
bta_dm_sec_cb.pin_dev_class = dev_class;
- if ((get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
- bd_addr, bta_dm_pinname_cback, BT_TRANSPORT_BR_EDR)) == BTM_CMD_STARTED) {
- return BTM_CMD_STARTED;
+ if ((get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(bd_addr, bta_dm_pinname_cback,
+ BT_TRANSPORT_BR_EDR)) ==
+ tBTM_STATUS::BTM_CMD_STARTED) {
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::warn("Failed to start Remote Name Request, addr:{}", bd_addr);
@@ -280,7 +281,7 @@ static tBTM_STATUS bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_cla
bd_name_copy(sec_event.pin_req.bd_name, bd_name);
bta_dm_sec_cb.p_sec_cback(BTA_DM_PIN_REQ_EVT, &sec_event);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -329,7 +330,7 @@ static tBTM_STATUS bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLAS
bta_dm_reset_sec_dev_pending(p_auth_cmpl->bd_addr);
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -388,7 +389,7 @@ static void bta_dm_authentication_complete_cback(const RawAddress& bd_addr,
*
******************************************************************************/
static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
- tBTM_STATUS status = BTM_CMD_STARTED;
+ tBTM_STATUS status = tBTM_STATUS::BTM_CMD_STARTED;
tBTA_DM_SEC sec_event = {};
tBTA_DM_SEC_EVT pin_evt = BTA_DM_SP_KEY_NOTIF_EVT;
@@ -454,7 +455,7 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data)
const tBTM_STATUS btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
p_data->cfm_req.bd_addr, bta_dm_pinname_cback, BT_TRANSPORT_BR_EDR);
switch (btm_status) {
- case BTM_CMD_STARTED:
+ case tBTM_STATUS::BTM_CMD_STARTED:
return btm_status;
default:
// NOTE: This will issue callback on this failure path
@@ -474,8 +475,8 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data)
bta_dm_sec_cb.pin_dev_class = p_data->key_notif.dev_class;
if ((get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
p_data->key_notif.bd_addr, bta_dm_pinname_cback, BT_TRANSPORT_BR_EDR)) ==
- BTM_CMD_STARTED) {
- return BTM_CMD_STARTED;
+ tBTM_STATUS::BTM_CMD_STARTED) {
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::warn("Failed to start Remote Name Request, addr:{}", p_data->key_notif.bd_addr);
} else {
@@ -846,8 +847,9 @@ void bta_dm_set_encryption(const RawAddress& bd_addr, tBT_TRANSPORT transport,
return;
}
- if (get_btm_client_interface().security.BTM_SetEncryption(
- bd_addr, transport, bta_dm_encrypt_cback, NULL, sec_act) == BTM_CMD_STARTED) {
+ if (get_btm_client_interface().security.BTM_SetEncryption(bd_addr, transport,
+ bta_dm_encrypt_cback, NULL, sec_act) ==
+ tBTM_STATUS::BTM_CMD_STARTED) {
device->p_encrypt_cback = p_callback;
log::debug("Started encryption peer:{} transport:{}", bd_addr, bt_transport_text(transport));
} else {
@@ -906,7 +908,7 @@ static tBTM_STATUS bta_dm_sirk_verifiction_cback(const RawAddress& bd_addr) {
if (bta_dm_sec_cb.p_sec_sirk_cback) {
log::debug("callback called");
bta_dm_sec_cb.p_sec_sirk_cback(BTA_DM_SIRK_VERIFICATION_REQ_EVT, &sec_event);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::debug("no callback registered");
diff --git a/system/bta/hearing_aid/hearing_aid.cc b/system/bta/hearing_aid/hearing_aid.cc
index 39f0ac9f04..a9be65f301 100644
--- a/system/bta/hearing_aid/hearing_aid.cc
+++ b/system/bta/hearing_aid/hearing_aid.cc
@@ -1974,7 +1974,7 @@ private:
device->num_intervals_since_last_rssi_read = 0;
log::debug("bd_addr={}", device->address);
if (get_btm_client_interface().link_controller.BTM_ReadRSSI(
- device->address, read_rssi_callback) != BTM_CMD_STARTED) {
+ device->address, read_rssi_callback) != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("Unable to read RSSI peer:{}", device->address);
}
}
diff --git a/system/bta/hf_client/bta_hf_client_sco.cc b/system/bta/hf_client/bta_hf_client_sco.cc
index 22b162ed40..05244a56b4 100644
--- a/system/bta/hf_client/bta_hf_client_sco.cc
+++ b/system/bta/hf_client/bta_hf_client_sco.cc
@@ -63,7 +63,7 @@ static bool bta_hf_client_sco_remove(tBTA_HF_CLIENT_CB* client_cb) {
log::verbose("idx 0x{:04x}, status:0x{:x}", client_cb->sco_idx, status);
- if (status == BTM_CMD_STARTED) {
+ if (status == tBTM_STATUS::BTM_CMD_STARTED) {
removed_started = true;
}
/* If no connection reset the SCO handle */
@@ -263,7 +263,7 @@ static void bta_hf_client_sco_create(tBTA_HF_CLIENT_CB* client_cb, bool is_orig)
status = get_btm_client_interface().sco.BTM_CreateSco(
&client_cb->peer_addr, is_orig, params.packet_types, &client_cb->sco_idx,
bta_hf_client_sco_conn_cback, bta_hf_client_sco_disc_cback);
- if (status == BTM_CMD_STARTED && !is_orig) {
+ if (status == tBTM_STATUS::BTM_CMD_STARTED && !is_orig) {
if (get_btm_client_interface().sco.BTM_RegForEScoEvts(
client_cb->sco_idx, bta_hf_client_esco_connreq_cback) == tBTM_STATUS::BTM_SUCCESS) {
log::verbose("SCO registration success");
diff --git a/system/bta/test/bta_ag_test.cc b/system/bta/test/bta_ag_test.cc
index eee21f4304..30e2634571 100644
--- a/system/bta/test/bta_ag_test.cc
+++ b/system/bta/test/bta_ag_test.cc
@@ -283,7 +283,7 @@ TEST_F_WITH_FLAGS(BtaAgCmdTest, at_hfp_cback__qcs_ev_codec_q0_enabled,
uint16_t* /* p_sco_inx */, tBTM_SCO_CB* /* p_conn_cb */,
tBTM_SCO_CB* /* p_disc_cb */) -> tBTM_STATUS {
inc_func_call_count("BTM_CreateSco");
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
};
tBTA_AG_SCB p_scb = {.peer_addr = addr,
@@ -323,7 +323,7 @@ TEST_F_WITH_FLAGS(BtaAgCmdTest, handle_swb_at_event__qcs_ev_codec_q1_fallback_to
uint16_t* /* p_sco_inx */, tBTM_SCO_CB* /* p_conn_cb */,
tBTM_SCO_CB* /* p_disc_cb */) -> tBTM_STATUS {
inc_func_call_count("BTM_CreateSco");
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
};
tBTA_AG_SCB p_scb = {.peer_addr = addr,
diff --git a/system/bta/test/bta_dm_test.cc b/system/bta/test/bta_dm_test.cc
index c9dcf38ab0..13782e2cfa 100644
--- a/system/bta/test/bta_dm_test.cc
+++ b/system/bta/test/bta_dm_test.cc
@@ -245,7 +245,7 @@ TEST_F(BtaDmTest, bta_dm_set_encryption) {
[](const RawAddress& bd_addr, tBT_TRANSPORT transport, tBTM_SEC_CALLBACK* p_callback,
void* p_ref_data, tBTM_BLE_SEC_ACT sec_act) -> tBTM_STATUS {
inc_func_call_count("BTM_SetEncryption");
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
};
bta_dm_set_encryption(kRawAddress, transport, BTA_DM_ENCRYPT_CBACK, sec_act);
diff --git a/system/bta/test/bta_sec_test.cc b/system/bta/test/bta_sec_test.cc
index 9a8594fe65..6a9b52150d 100644
--- a/system/bta/test/bta_sec_test.cc
+++ b/system/bta/test/bta_sec_test.cc
@@ -60,7 +60,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithName) {
static bool callback_sent = false;
mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName =
[](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb,
- tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_CMD_STARTED; };
+ tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; };
static tBTA_DM_SP_CFM_REQ cfm_req{};
bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) {
@@ -87,7 +87,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithName) {
bd_name_from_char_pointer(data.cfm_req.bd_name, kRemoteName);
ASSERT_EQ(
- btm_status_text(BTM_CMD_STARTED),
+ btm_status_text(tBTM_STATUS::BTM_CMD_STARTED),
btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_CFM_REQ_EVT, &data)));
ASSERT_EQ(kNumVal, bta_dm_sec_cb.num_val);
ASSERT_TRUE(callback_sent);
@@ -109,7 +109,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRSuccess) {
reset_mock_btm_client_interface();
mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName =
[](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb,
- tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_CMD_STARTED; };
+ tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; };
static tBTA_DM_SP_CFM_REQ cfm_req{};
bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) {
@@ -135,7 +135,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRSuccess) {
data.cfm_req.dev_class = kDeviceClass;
ASSERT_EQ(
- btm_status_text(BTM_CMD_STARTED),
+ btm_status_text(tBTM_STATUS::BTM_CMD_STARTED),
btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_CFM_REQ_EVT, &data)));
ASSERT_EQ(kNumVal, bta_dm_sec_cb.num_val);
ASSERT_FALSE(callback_sent);
@@ -172,7 +172,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRFail) {
data.cfm_req.dev_class = kDeviceClass;
ASSERT_EQ(
- btm_status_text(BTM_CMD_STARTED),
+ btm_status_text(tBTM_STATUS::BTM_CMD_STARTED),
btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_CFM_REQ_EVT, &data)));
ASSERT_EQ(kNumVal, bta_dm_sec_cb.num_val);
ASSERT_TRUE(callback_sent);
@@ -192,7 +192,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_KEY_NOTIF_EVT) {
static bool callback_sent = false;
mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName =
[](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb,
- tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_CMD_STARTED; };
+ tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; };
static tBTA_DM_SP_KEY_NOTIF key_notif{};
bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) {
@@ -213,7 +213,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_KEY_NOTIF_EVT) {
data.key_notif.dev_class = kDeviceClass;
bd_name_from_char_pointer(data.key_notif.bd_name, kRemoteName);
- ASSERT_EQ(btm_status_text(BTM_CMD_STARTED),
+ ASSERT_EQ(btm_status_text(tBTM_STATUS::BTM_CMD_STARTED),
btm_status_text(
bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_KEY_NOTIF_EVT, &data)));
ASSERT_EQ(kPassKey, bta_dm_sec_cb.num_val);
diff --git a/system/bta/test/bta_test_fixtures.h b/system/bta/test/bta_test_fixtures.h
index 93739dc32f..9e719872a2 100644
--- a/system/bta/test/bta_test_fixtures.h
+++ b/system/bta/test/bta_test_fixtures.h
@@ -74,7 +74,7 @@ protected:
return tBTM_STATUS::BTM_SUCCESS;
};
mock_btm_client_interface.local.BTM_ReadLocalDeviceNameFromController =
- [](tBTM_CMPL_CB* cb) -> tBTM_STATUS { return BTM_CMD_STARTED; };
+ [](tBTM_CMPL_CB* cb) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; };
mock_btm_client_interface.security.BTM_SecRegister =
[](const tBTM_APPL_INFO* p_cb_info) -> bool { return true; };
}
diff --git a/system/btif/src/btif_a2dp_source.cc b/system/btif/src/btif_a2dp_source.cc
index 1047ee7f2c..9fccfabceb 100644
--- a/system/btif/src/btif_a2dp_source.cc
+++ b/system/btif/src/btif_a2dp_source.cc
@@ -918,7 +918,7 @@ static bool btif_a2dp_source_enqueue_callback(BT_HDR* p_buf, size_t frames_n,
RawAddress peer_bda = btif_av_source_active_peer();
tBTM_STATUS status =
get_btm_client_interface().link_controller.BTM_ReadRSSI(peer_bda, btm_read_rssi_cb);
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("Cannot read RSSI: status {}", status);
}
@@ -930,13 +930,13 @@ static bool btif_a2dp_source_enqueue_callback(BT_HDR* p_buf, size_t frames_n,
// creating a framework to avoid ifdefs.
#ifndef TARGET_FLOSS
status = BTM_ReadFailedContactCounter(peer_bda, btm_read_failed_contact_counter_cb);
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("Cannot read Failed Contact Counter: status {}", status);
}
#endif
status = BTM_ReadTxPower(peer_bda, BT_TRANSPORT_BR_EDR, btm_read_tx_power_cb);
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("Cannot read Tx Power: status {}", status);
}
}
diff --git a/system/btif/src/btif_sock_sco.cc b/system/btif/src/btif_sock_sco.cc
index 285f417297..5035757a38 100644
--- a/system/btif/src/btif_sock_sco.cc
+++ b/system/btif/src/btif_sock_sco.cc
@@ -155,7 +155,7 @@ static sco_socket_t* sco_socket_establish_locked(bool is_listening, const RawAdd
status = get_btm_client_interface().sco.BTM_CreateSco(
bd_addr, !is_listening, params.packet_types, &sco_socket->sco_handle,
connect_completed_cb, disconnect_completed_cb);
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
log::error("unable to create SCO socket: {}", status);
goto error;
}
diff --git a/system/stack/acl/btm_acl.cc b/system/stack/acl/btm_acl.cc
index fda5bfd962..68f0c23e9d 100644
--- a/system/stack/acl/btm_acl.cc
+++ b/system/stack/acl/btm_acl.cc
@@ -527,7 +527,7 @@ tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, tHCI_ROLE* p_role) {
* peripheral. If role is already set it will do nothing.
*
* Returns tBTM_STATUS::BTM_SUCCESS if already in specified role.
- * BTM_CMD_STARTED if command issued to controller.
+ * tBTM_STATUS::BTM_CMD_STARTED if command issued to controller.
* BTM_NO_RESOURCES if couldn't allocate memory to issue
* command
* BTM_UNKNOWN_ADDR if no active link with bd addr specified
@@ -599,7 +599,7 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) {
}
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -1069,7 +1069,7 @@ tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda, uint16_t timeout)
btsnd_hcic_write_link_super_tout(p_acl->hci_handle, timeout);
log::debug("Set supervision timeout:{:.2f}ms bd_addr:{}",
supervision_timeout_to_seconds(timeout), remote_bda);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
} else {
log::warn(
"Role is peripheral so unable to set supervision timeout:{:.2f}ms "
@@ -1562,7 +1562,7 @@ uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr) {
* callback.
* (tBTM_RSSI_RESULT)
*
- * Returns BTM_CMD_STARTED if successfully initiated or error code
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated or error code
*
******************************************************************************/
tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
@@ -1591,7 +1591,7 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
btm_read_rssi_timeout, NULL);
btsnd_hcic_read_rssi(p->hci_handle);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::warn("Unable to find active acl");
@@ -1607,7 +1607,7 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
* The result is returned in the callback.
* (tBTM_FAILED_CONTACT_COUNTER_RESULT)
*
- * Returns BTM_CMD_STARTED if successfully initiated or error code
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated or error code
*
******************************************************************************/
tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
@@ -1633,7 +1633,7 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL
btm_read_failed_contact_counter_timeout, NULL);
btsnd_hcic_read_failed_contact_counter(p->hci_handle);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::warn("Unable to find active acl");
@@ -1650,7 +1650,7 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL
* are returned in the callback.
* (tBTM_RSSI_RESULT)
*
- * Returns BTM_CMD_STARTED if successfully initiated or error code
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated or error code
*
******************************************************************************/
tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transport,
@@ -1679,7 +1679,7 @@ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transpor
btsnd_hcic_read_tx_power(p->hci_handle, BTM_READ_RSSI_TYPE_CUR);
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::warn("Unable to find active acl");
diff --git a/system/stack/acl/btm_pm.cc b/system/stack/acl/btm_pm.cc
index eb3d8ff6e6..318517fc80 100644
--- a/system/stack/acl/btm_pm.cc
+++ b/system/stack/acl/btm_pm.cc
@@ -600,7 +600,7 @@ static tBTM_STATUS btm_pm_snd_md_req(uint16_t handle, uint8_t pm_id, int link_in
return BTM_NO_RESOURCES;
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
static void btm_pm_continue_pending_mode_changes() {
diff --git a/system/stack/btm/btm_ble_cont_energy.cc b/system/stack/btm/btm_ble_cont_energy.cc
index fc95f85caa..c726833c0c 100644
--- a/system/stack/btm/btm_ble_cont_energy.cc
+++ b/system/stack/btm/btm_ble_cont_energy.cc
@@ -98,5 +98,5 @@ tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK* p_ener_cback) {
ble_energy_info_cb.p_ener_cback = p_ener_cback;
get_btm_client_interface().vendor.BTM_VendorSpecificCommand(HCI_BLE_ENERGY_INFO, 0, NULL,
btm_ble_cont_energy_cmpl_cback);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc
index 4eafc05d69..a0f5a9f972 100644
--- a/system/stack/btm/btm_ble_gap.cc
+++ b/system/stack/btm/btm_ble_gap.cc
@@ -551,7 +551,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_
btm_cb.ble_ctr_cb.inq_var.scan_window == ll_scan_window;
if (is_ongoing_low_latency) {
log::warn("Observer was already active, is_low_latency: {}", is_ongoing_low_latency);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
// stop any scan without low latency config
btm_ble_stop_observe();
@@ -559,7 +559,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_
btm_cb.ble_ctr_cb.p_obs_results_cb = p_results_cb;
btm_cb.ble_ctr_cb.p_obs_cmpl_cb = p_cmpl_cb;
- status = BTM_CMD_STARTED;
+ status = tBTM_STATUS::BTM_CMD_STARTED;
/* scan is not started */
if (!btm_cb.ble_ctr_cb.is_ble_scan_active()) {
@@ -585,7 +585,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_
BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le observe started",
"low latency scanning enabled");
- if (status == BTM_CMD_STARTED) {
+ if (status == tBTM_STATUS::BTM_CMD_STARTED) {
btm_cb.ble_ctr_cb.set_ble_observe_active();
if (duration != 0) {
/* start observer timer */
@@ -601,7 +601,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_
base::StringPrintf("duration_s:%6.3f results:%-3lu",
(double)duration_timestamp / 1000.0,
btm_cb.neighbor.le_observe.results));
- status = BTM_CMD_STARTED;
+ status = tBTM_STATUS::BTM_CMD_STARTED;
btm_ble_stop_observe();
} else {
log::error("Observe not active");
@@ -1582,7 +1582,7 @@ tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) {
};
BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le inquiry started");
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -1650,7 +1650,7 @@ tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_NAME_CMP
alarm_set_on_mloop(btm_cb.rnr.remote_name_timer, BTM_EXT_BLE_RMT_NAME_TIMEOUT_MS,
btm_inq_remote_name_timer_timeout, NULL);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
diff --git a/system/stack/btm/btm_ble_privacy.cc b/system/stack/btm/btm_ble_privacy.cc
index 5e807c1ea4..c1f8a5b358 100644
--- a/system/stack/btm/btm_ble_privacy.cc
+++ b/system/stack/btm/btm_ble_privacy.cc
@@ -458,7 +458,7 @@ static tBTM_STATUS btm_ble_remove_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_r
btm_ble_resolving_list_vsc_op_cmpl);
btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr, BTM_BLE_META_REMOVE_IRK_ENTRY);
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
diff --git a/system/stack/btm/btm_ble_sec.cc b/system/stack/btm/btm_ble_sec.cc
index ff72c64623..1265d57f0c 100644
--- a/system/stack/btm/btm_ble_sec.cc
+++ b/system/stack/btm/btm_ble_sec.cc
@@ -1158,7 +1158,7 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr, tBTM_BLE_SEC_ACT s
}
if (SMP_Pair(bd_addr) == SMP_STARTED) {
- cmd = BTM_CMD_STARTED;
+ cmd = tBTM_STATUS::BTM_CMD_STARTED;
p_rec->sec_rec.le_link = tSECURITY_STATE::AUTHENTICATING;
}
break;
@@ -1242,7 +1242,7 @@ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, Octet16*
p_rec->sec_rec.le_link = tSECURITY_STATE::ENCRYPTING;
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -1683,7 +1683,7 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr,
case SMP_SIRK_VERIFICATION_REQ_EVT:
res = (*btm_sec_cb.api.p_sirk_verification_callback)(bd_addr);
log::debug("SMP SIRK verification result:{}", btm_status_text(res));
- if (res != BTM_CMD_STARTED) {
+ if (res != tBTM_STATUS::BTM_CMD_STARTED) {
return res;
}
diff --git a/system/stack/btm/btm_devctl.cc b/system/stack/btm/btm_devctl.cc
index d88d7d430f..6c162c7435 100644
--- a/system/stack/btm/btm_devctl.cc
+++ b/system/stack/btm/btm_devctl.cc
@@ -340,7 +340,7 @@ tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name) {
bd_name_from_char_pointer(btm_sec_cb.cfg.bd_name, p_name);
bluetooth::shim::GetController()->WriteLocalName(p_name);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -368,7 +368,7 @@ tBTM_STATUS BTM_ReadLocalDeviceName(const char** p_name) {
* Description Get local device name from controller. Do not use cached
* name (used to get chip-id prior to btm reset complete).
*
- * Returns BTM_CMD_STARTED if successful, otherwise an error
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successful, otherwise an error
*
******************************************************************************/
tBTM_STATUS BTM_ReadLocalDeviceNameFromController(tBTM_CMPL_CB* p_rln_cmpl_cback) {
@@ -384,7 +384,7 @@ tBTM_STATUS BTM_ReadLocalDeviceNameFromController(tBTM_CMPL_CB* p_rln_cmpl_cback
alarm_set_on_mloop(btm_cb.devcb.read_local_name_timer, BTM_DEV_NAME_REPLY_TIMEOUT_MS,
btm_read_local_name_timeout, NULL);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
diff --git a/system/stack/btm/btm_inq.cc b/system/stack/btm/btm_inq.cc
index 9756f66037..5d6369a5cd 100644
--- a/system/stack/btm/btm_inq.cc
+++ b/system/stack/btm/btm_inq.cc
@@ -620,7 +620,7 @@ static tBTM_STATUS BTM_StartLeScan() {
#else
if (shim::GetController()->SupportsBle()) {
btm_ble_start_inquiry(btm_cb.btm_inq_vars.inqparms.duration);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::warn("Trying to do LE scan on a non-LE adapter");
btm_cb.btm_inq_vars.inqparms.mode &= ~BTM_BLE_GENERAL_INQUIRY;
@@ -657,7 +657,7 @@ static tBTM_STATUS BTM_StartLeScan() {
* NULL, the application is not notified when
* completed.
* Returns tBTM_STATUS
- * BTM_CMD_STARTED if successfully initiated
+ * tBTM_STATUS::BTM_CMD_STARTED if successfully initiated
* tBTM_STATUS::BTM_BUSY if already in progress
* BTM_ILLEGAL_VALUE if parameter(s) are out of range
* BTM_NO_RESOURCES if could not allocate resources to start
@@ -771,7 +771,7 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_
}
#endif
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
diff --git a/system/stack/btm/btm_sco.cc b/system/stack/btm/btm_sco.cc
index 948df2e20f..33aaa80738 100644
--- a/system/stack/btm/btm_sco.cc
+++ b/system/stack/btm/btm_sco.cc
@@ -669,7 +669,7 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle, enh_esco_params
}
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -687,7 +687,7 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle, enh_esco_params
* tBTM_STATUS::BTM_BUSY if another SCO being set up to
* the same BD address
* BTM_NO_RESOURCES if the max SCO limit has been reached
- * BTM_CMD_STARTED if the connection establishment is started.
+ * tBTM_STATUS::BTM_CMD_STARTED if the connection establishment is started.
* In this case, "*p_sco_inx" is filled in
* with the sco index used for the connection.
*
@@ -798,7 +798,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig, uint16_t p
if (is_orig) {
log::debug("Initiating (e)SCO link for ACL handle:0x{:04x}", acl_handle);
- if ((btm_send_connect_request(acl_handle, p_setup)) != BTM_CMD_STARTED) {
+ if ((btm_send_connect_request(acl_handle, p_setup)) != tBTM_STATUS::BTM_CMD_STARTED) {
log::error("failed to send connect request for {}", *remote_bda);
return BTM_NO_RESOURCES;
}
@@ -816,7 +816,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig, uint16_t p
BTM_LogHistory(kBtmLogTag, *remote_bda, "Connecting",
base::StringPrintf("local initiated acl:0x%04x", acl_handle));
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
}
@@ -846,7 +846,7 @@ void btm_sco_chk_pend_unpark(tHCI_STATUS hci_status, uint16_t hci_handle) {
"{} unparked, sending connection request, acl_handle={}, "
"hci_status={}",
p->esco.data.bd_addr, unsigned(acl_handle), unsigned(hci_status));
- if (btm_send_connect_request(acl_handle, &p->esco.setup) == BTM_CMD_STARTED) {
+ if (btm_send_connect_request(acl_handle, &p->esco.setup) == tBTM_STATUS::BTM_CMD_STARTED) {
p->state = SCO_ST_CONNECTING;
} else {
log::error("failed to send connection request for {}", p->esco.data.bd_addr);
@@ -880,7 +880,7 @@ void btm_sco_chk_pend_rolechange(uint16_t hci_handle) {
log::verbose("btm_sco_chk_pend_rolechange -> (e)SCO Link for ACL handle 0x{:04x}",
acl_handle);
- if ((btm_send_connect_request(acl_handle, &p->esco.setup)) == BTM_CMD_STARTED) {
+ if ((btm_send_connect_request(acl_handle, &p->esco.setup)) == tBTM_STATUS::BTM_CMD_STARTED) {
p->state = SCO_ST_CONNECTING;
}
}
@@ -1163,7 +1163,7 @@ tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx) {
if (BTM_ReadPowerMode(p->esco.data.bd_addr, &state) && (state == BTM_PM_ST_PENDING)) {
log::verbose("BTM_PM_ST_PENDING for ACL mapped with SCO Link 0x{:04x}", p->hci_handle);
p->state = SCO_ST_PEND_MODECHANGE;
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
tSCO_STATE old_state = p->state;
@@ -1175,7 +1175,7 @@ tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx) {
BTM_LogHistory(kBtmLogTag, p->esco.data.bd_addr, "Disconnecting",
base::StringPrintf("local initiated handle:0x%04x previous_state:%s", p->Handle(),
sco_state_text(old_state).c_str()));
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
void BTM_RemoveScoByBdaddr(const RawAddress& bda) {
@@ -1433,7 +1433,7 @@ tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx, tBTM_ESCO_CBACK* p_esco_cback)
* Note: If called over a SCO link (including 1.1 controller),
* a change packet type request is sent out instead.
*
- * Returns BTM_CMD_STARTED if command is successfully initiated.
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if command is successfully initiated.
* BTM_NO_RESOURCES - not enough resources to initiate command.
* BTM_WRONG_MODE if no connection with a peer device or bad
* sco_inx.
@@ -1501,7 +1501,7 @@ static tBTM_STATUS BTM_ChangeEScoLinkParms(uint16_t sco_inx, tBTM_CHG_ESCO_PARAM
p_parms->retransmission_effort, temp_packet_types);
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
diff --git a/system/stack/btm/btm_sec.cc b/system/stack/btm/btm_sec.cc
index 042c566e47..4095a0636e 100644
--- a/system/stack/btm/btm_sec.cc
+++ b/system/stack/btm/btm_sec.cc
@@ -624,7 +624,7 @@ void BTM_PINCodeReply(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t pin_le
"BTM_PINCodeReply(): link is connecting so wait pin code request "
"from peer");
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ);
- } else if (btm_sec_dd_create_conn(p_dev_rec) != BTM_CMD_STARTED) {
+ } else if (btm_sec_dd_create_conn(p_dev_rec) != tBTM_STATUS::BTM_CMD_STARTED) {
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE);
p_dev_rec->sec_rec.sec_flags &= ~BTM_SEC_LINK_KEY_AUTHED;
@@ -709,7 +709,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE
btm_sec_cb.pairing_flags |= BTM_PAIR_FLAGS_LE_ACTIVE;
p_dev_rec->sec_rec.le_link = tSECURITY_STATE::AUTHENTICATING;
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_AUTH_COMPLETE);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
btm_sec_cb.pairing_flags = 0;
@@ -746,7 +746,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE
/* Mark lcb as bonding */
l2cu_update_lcb_4_bonding(bd_addr, true);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
log::debug("An ACL connection does not currently exist peer:{} transport:{}", bd_addr,
bt_transport_text(transport));
@@ -757,7 +757,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE
if (btm_sec_check_prefetch_pin(p_dev_rec)) {
log::debug("Class of device used to check for pin peer:{} transport:{}", bd_addr,
bt_transport_text(transport));
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
}
if ((btm_sec_cb.security_mode == BTM_SEC_MODE_SP ||
@@ -774,7 +774,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE
} else {
/* We are accepting connection request from peer */
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ);
- status = BTM_CMD_STARTED;
+ status = tBTM_STATUS::BTM_CMD_STARTED;
}
log::verbose("State:{} sm4: 0x{:x} le_link_state:{} classic_link_state:{}",
tBTM_SEC_CB::btm_pair_state_descr(btm_sec_cb.pairing_state), p_dev_rec->sm4,
@@ -784,7 +784,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE
status = btm_sec_dd_create_conn(p_dev_rec);
}
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
log::error("BTM_ReadRemoteDeviceName or btm_sec_dd_create_conn error: 0x{:x}", (int)status);
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE);
}
@@ -856,7 +856,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) {
if (p_dev_rec->sec_rec.le_link == tSECURITY_STATE::AUTHENTICATING) {
log::verbose("Cancel LE pairing");
if (SMP_PairCancel(bd_addr)) {
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
}
return BTM_WRONG_MODE;
@@ -878,7 +878,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) {
if (p_dev_rec->hci_handle != HCI_INVALID_HANDLE) {
/* If some other thread disconnecting, we do not send second command */
if (p_dev_rec->sec_rec.classic_link == tSECURITY_STATE::DISCONNECTING) {
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/* If the HCI link was set up by Bonding process */
@@ -895,7 +895,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) {
/* If the HCI link creation was started by Bonding process */
if (btm_sec_cb.pairing_flags & BTM_PAIR_FLAGS_DISC_WHEN_DONE) {
btsnd_hcic_create_conn_cancel(bd_addr);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
if (btm_sec_cb.pairing_state == BTM_PAIR_STATE_GET_REM_NAME) {
if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() !=
@@ -903,7 +903,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) {
log::warn("Unable to cancel RNR");
}
btm_sec_cb.pairing_flags |= BTM_PAIR_FLAGS_WE_CANCEL_DD;
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
return BTM_NOT_AUTHORIZED;
}
@@ -1035,7 +1035,7 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport
log::warn("Security Manager: BTM_SetEncryption busy, enqueue request");
btm_sec_queue_encrypt_request(bd_addr, transport, p_callback, p_ref_data, sec_act);
log::info("Queued start encryption");
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
p_dev_rec->sec_rec.p_callback = p_callback;
@@ -1072,7 +1072,7 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport
}
switch (rc) {
- case BTM_CMD_STARTED:
+ case tBTM_STATUS::BTM_CMD_STARTED:
case tBTM_STATUS::BTM_BUSY:
break;
@@ -1103,13 +1103,13 @@ static tBTM_STATUS btm_sec_send_hci_disconnect(tBTM_SEC_DEV_REC* p_dev_rec, tHCI
if (conn_handle == p_dev_rec->hci_handle) {
if (p_dev_rec->sec_rec.classic_link == tSECURITY_STATE::DISCONNECTING) {
// Already sent classic disconnect
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
p_dev_rec->sec_rec.classic_link = tSECURITY_STATE::DISCONNECTING;
} else if (conn_handle == p_dev_rec->ble_hci_handle) {
if (p_dev_rec->sec_rec.le_link == tSECURITY_STATE::DISCONNECTING) {
// Already sent ble disconnect
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
p_dev_rec->sec_rec.le_link = tSECURITY_STATE::DISCONNECTING;
} else {
@@ -1123,7 +1123,7 @@ static tBTM_STATUS btm_sec_send_hci_disconnect(tBTM_SEC_DEV_REC* p_dev_rec, tHCI
hci_reason_code_text(reason));
acl_disconnect_after_role_switch(conn_handle, reason, comment);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -1466,7 +1466,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
if ((p_dev_rec->sec_rec.p_callback) || (btm_sec_cb.pairing_state != BTM_PAIR_STATE_IDLE)) {
log::debug("security_flags:x{:x}, sec_flags:x{:x}", security_required,
p_dev_rec->sec_rec.sec_flags);
- rc = BTM_CMD_STARTED;
+ rc = tBTM_STATUS::BTM_CMD_STARTED;
if ((btm_sec_cb.security_mode == BTM_SEC_MODE_SERVICE) || (BTM_SM4_KNOWN == p_dev_rec->sm4) ||
(BTM_SEC_IS_SM4(p_dev_rec->sm4) &&
(!btm_sec_is_upgrade_possible(p_dev_rec, is_originator)))) {
@@ -1499,7 +1499,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
if ((rc == tBTM_STATUS::BTM_SUCCESS) && (security_required & BTM_SEC_MODE4_LEVEL4) &&
(p_dev_rec->sec_rec.link_key_type != BTM_LKEY_TYPE_AUTH_COMB_P_256)) {
- rc = BTM_CMD_STARTED;
+ rc = tBTM_STATUS::BTM_CMD_STARTED;
}
if (rc == tBTM_STATUS::BTM_SUCCESS) {
@@ -1518,7 +1518,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
}
btm_sec_cb.sec_req_pending = true;
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/* Save the security requirements in case a pairing is needed */
@@ -1544,7 +1544,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
p_dev_rec->sec_rec.sec_flags, (is_originator) ? "initiator" : "acceptor");
p_dev_rec->sm4 |= BTM_SM4_REQ_PEND;
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
}
@@ -1601,7 +1601,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
}
rc = btm_sec_execute_procedure(p_dev_rec);
- if (rc != BTM_CMD_STARTED) {
+ if (rc != tBTM_STATUS::BTM_CMD_STARTED) {
log::verbose("p_dev_rec={}, clearing callback. old p_callback={}", fmt::ptr(p_dev_rec),
fmt::ptr(p_dev_rec->sec_rec.p_callback));
p_dev_rec->sec_rec.p_callback = NULL;
@@ -1684,7 +1684,7 @@ tBTM_STATUS btm_sec_l2cap_access_req(const RawAddress& bd_addr, uint16_t psm, bo
* p_ref_data - Pointer to any reference data needed by the
* the callback function.
*
- * Returns BTM_CMD_STARTED
+ * Returns tBTM_STATUS::BTM_CMD_STARTED
*
******************************************************************************/
tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_originator,
@@ -1706,7 +1706,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina
log::debug("Pairing in progress pairing_state:{}",
tBTM_SEC_CB::btm_pair_state_descr(btm_sec_cb.pairing_state));
- rc = BTM_CMD_STARTED;
+ rc = tBTM_STATUS::BTM_CMD_STARTED;
if ((btm_sec_cb.security_mode == BTM_SEC_MODE_SERVICE) || (BTM_SM4_KNOWN == p_dev_rec->sm4) ||
(BTM_SEC_IS_SM4(p_dev_rec->sm4) &&
@@ -1739,16 +1739,16 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina
}
if ((rc == tBTM_STATUS::BTM_SUCCESS) && (security_required & BTM_SEC_MODE4_LEVEL4) &&
(p_dev_rec->sec_rec.link_key_type != BTM_LKEY_TYPE_AUTH_COMB_P_256)) {
- rc = BTM_CMD_STARTED;
+ rc = tBTM_STATUS::BTM_CMD_STARTED;
}
}
/* the new security request */
if (p_dev_rec->sec_rec.classic_link != tSECURITY_STATE::IDLE) {
log::debug("A pending security procedure in progress");
- rc = BTM_CMD_STARTED;
+ rc = tBTM_STATUS::BTM_CMD_STARTED;
}
- if (rc == BTM_CMD_STARTED) {
+ if (rc == tBTM_STATUS::BTM_CMD_STARTED) {
btm_sec_queue_mx_request(bd_addr, BT_PSM_RFCOMM, is_originator, security_required, p_callback,
p_ref_data);
} else /* rc == tBTM_STATUS::BTM_SUCCESS */
@@ -1822,7 +1822,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina
rc = btm_sec_execute_procedure(p_dev_rec);
log::debug("Started security procedure peer:{} btm_status:{}", p_dev_rec->RemoteAddress(),
btm_status_text(rc));
- if (rc != BTM_CMD_STARTED) {
+ if (rc != tBTM_STATUS::BTM_CMD_STARTED) {
if (p_callback) {
p_dev_rec->sec_rec.p_callback = NULL;
(*p_callback)(bd_addr, transport, p_ref_data, rc);
@@ -2051,20 +2051,20 @@ void btm_sec_abort_access_req(const RawAddress& bd_addr) {
* the dedicated bonding process
*
* Returns tBTM_STATUS::BTM_SUCCESS if an ACL connection is already up
- * BTM_CMD_STARTED if the ACL connection has been requested
+ * tBTM_STATUS::BTM_CMD_STARTED if the ACL connection has been requested
* BTM_NO_RESOURCES if failed to start the ACL connection
*
******************************************************************************/
static tBTM_STATUS btm_sec_dd_create_conn(tBTM_SEC_DEV_REC* p_dev_rec) {
tBTM_STATUS status = l2cu_ConnectAclForSecurity(p_dev_rec->bd_addr);
- if (status == BTM_CMD_STARTED) {
+ if (status == tBTM_STATUS::BTM_CMD_STARTED) {
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ);
/* If already connected, start pending security procedure */
if (get_btm_client_interface().peer.BTM_IsAclConnectionUp(p_dev_rec->bd_addr,
BT_TRANSPORT_BR_EDR)) {
return tBTM_STATUS::BTM_SUCCESS;
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
} else if (status == BTM_NO_RESOURCES) {
return BTM_NO_RESOURCES;
}
@@ -2076,7 +2076,7 @@ static tBTM_STATUS btm_sec_dd_create_conn(tBTM_SEC_DEV_REC* p_dev_rec) {
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -2322,7 +2322,7 @@ void btm_sec_rmt_name_request_complete(const RawAddress* p_bd_addr, const uint8_
bluetooth::metrics::LogAclAfterRemoteNameRequest(bd_addr, req_status);
if (req_status == tBTM_STATUS::BTM_SUCCESS) {
await_connection = false;
- } else if (req_status != BTM_CMD_STARTED) {
+ } else if (req_status != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("failed to start connection");
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE);
@@ -2379,7 +2379,7 @@ void btm_sec_rmt_name_request_complete(const RawAddress* p_bd_addr, const uint8_
tBTM_STATUS btm_status = btm_sec_execute_procedure(p_dev_rec);
/* If result is pending reply from the user or from the device is pending */
- if (btm_status == BTM_CMD_STARTED) {
+ if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) {
return;
}
@@ -3156,7 +3156,7 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) {
/* If there is no next procedure, or procedure failed to start, notify the
* caller */
- if (btm_status != BTM_CMD_STARTED) {
+ if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) {
btm_sec_dev_rec_cback_event(p_dev_rec, btm_status, false);
}
}
@@ -3340,7 +3340,7 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status, uint8_t encr_en
tBTM_STATUS btm_status = btm_sec_execute_procedure(p_dev_rec);
/* If there is no next procedure, or procedure failed to start, notify the
* caller */
- if (static_cast<std::underlying_type_t<tHCI_STATUS>>(status) != BTM_CMD_STARTED) {
+ if (static_cast<std::underlying_type_t<tHCI_STATUS>>(status) != tBTM_STATUS::BTM_CMD_STARTED) {
btm_sec_dev_rec_cback_event(p_dev_rec, btm_status, false);
}
}
@@ -3439,7 +3439,7 @@ static void btm_sec_connect_after_reject_timeout(void* /* data */) {
log::verbose("restarting ACL connection");
btm_sec_cb.p_collided_dev_rec = 0;
- if (btm_sec_dd_create_conn(p_dev_rec) != BTM_CMD_STARTED) {
+ if (btm_sec_dd_create_conn(p_dev_rec) != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("Security Manager: failed to start connection");
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE);
@@ -3522,8 +3522,9 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS statu
/* remote device name is unknowm, start getting remote name first */
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_GET_REM_NAME);
- if (get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
- p_dev_rec->bd_addr, NULL, BT_TRANSPORT_BR_EDR) != BTM_CMD_STARTED) {
+ if (get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(p_dev_rec->bd_addr, NULL,
+ BT_TRANSPORT_BR_EDR) !=
+ tBTM_STATUS::BTM_CMD_STARTED) {
log::error("cannot read remote name");
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE);
}
@@ -3557,7 +3558,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS statu
/* Try again: RNR when no ACL causes HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT */
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_GET_REM_NAME);
if (get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
- bda, NULL, BT_TRANSPORT_BR_EDR) != BTM_CMD_STARTED) {
+ bda, NULL, BT_TRANSPORT_BR_EDR) != tBTM_STATUS::BTM_CMD_STARTED) {
log::error("cannot read remote name");
btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE);
}
@@ -3713,7 +3714,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS statu
log::debug("Is connection locally initiated:{}", p_dev_rec->is_originator);
if (!(p_dev_rec->sec_rec.sec_flags & BTM_SEC_NAME_KNOWN) || p_dev_rec->is_originator) {
tBTM_STATUS res = btm_sec_execute_procedure(p_dev_rec);
- if (res != BTM_CMD_STARTED) {
+ if (res != tBTM_STATUS::BTM_CMD_STARTED) {
btm_sec_dev_rec_cback_event(p_dev_rec, res, false);
}
}
@@ -4396,7 +4397,7 @@ void btm_sec_update_clock_offset(uint16_t handle, uint16_t clock_offset) {
* case performs only authorization.
*
* Returns tBTM_STATUS::BTM_SUCCESS - permission is granted
- * BTM_CMD_STARTED - in process
+ * tBTM_STATUS::BTM_CMD_STARTED - in process
* BTM_NO_RESOURCES - permission declined
*
******************************************************************************/
@@ -4409,7 +4410,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) {
if (p_dev_rec->sec_rec.classic_link != tSECURITY_STATE::IDLE) {
log::info("No immediate action taken in busy state: le_link={} classic_link={}",
p_dev_rec->sec_rec.le_link, p_dev_rec->sec_rec.classic_link);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/* If any security is required, get the name first */
@@ -4420,7 +4421,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) {
log::warn("Unable to start remote name request");
return BTM_NO_RESOURCES;
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/* If connection is not authenticated and authentication is required */
@@ -4482,7 +4483,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) {
}
btm_sec_wait_and_start_authentication(p_dev_rec);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
}
@@ -4498,7 +4499,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) {
btsnd_hcic_set_conn_encrypt(p_dev_rec->hci_handle, true);
p_dev_rec->sec_rec.classic_link = tSECURITY_STATE::ENCRYPTING;
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
} else {
log::debug("Encryption not required");
}
@@ -4620,7 +4621,7 @@ static void btm_sec_collision_timeout(void* /* data */) {
tBTM_STATUS status = btm_sec_execute_procedure(btm_sec_cb.p_collided_dev_rec);
/* If result is pending reply from the user or from the device is pending */
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
/* There is no next procedure or start of procedure failed, notify the
* waiting layer */
btm_sec_dev_rec_cback_event(btm_sec_cb.p_collided_dev_rec, status, false);
@@ -5037,7 +5038,7 @@ void btm_sec_set_peer_sec_caps(uint16_t hci_handle, bool ssp_supported, bool sc_
if (!(p_dev_rec->sec_rec.sec_flags & BTM_SEC_NAME_KNOWN) || p_dev_rec->is_originator) {
tBTM_STATUS btm_status = btm_sec_execute_procedure(p_dev_rec);
- if (btm_status != BTM_CMD_STARTED) {
+ if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) {
log::warn("Security procedure not started! status:{}", btm_status_text(btm_status));
btm_sec_dev_rec_cback_event(p_dev_rec, btm_status, false);
}
diff --git a/system/stack/btm/btm_sec.h b/system/stack/btm/btm_sec.h
index 0c073106e9..52fbd40af9 100644
--- a/system/stack/btm/btm_sec.h
+++ b/system/stack/btm/btm_sec.h
@@ -395,7 +395,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
*required procedures are completed p_ref_data - Pointer to any reference
*data needed by the the callback function.
*
- * Returns BTM_CMD_STARTED
+ * Returns tBTM_STATUS::BTM_CMD_STARTED
*
******************************************************************************/
tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_originator,
diff --git a/system/stack/gatt/gatt_auth.cc b/system/stack/gatt/gatt_auth.cc
index a89ec1e08f..7ed047b8eb 100644
--- a/system/stack/gatt/gatt_auth.cc
+++ b/system/stack/gatt/gatt_auth.cc
@@ -433,7 +433,8 @@ bool gatt_security_check_start(tGATT_CLCB* p_clcb) {
gatt_convert_sec_action(gatt_sec_act, &btm_ble_sec_act);
tBTM_STATUS btm_status = BTM_SetEncryption(p_tcb->peer_bda, p_tcb->transport,
gatt_enc_cmpl_cback, NULL, btm_ble_sec_act);
- if ((btm_status != tBTM_STATUS::BTM_SUCCESS) && (btm_status != BTM_CMD_STARTED)) {
+ if ((btm_status != tBTM_STATUS::BTM_SUCCESS) &&
+ (btm_status != tBTM_STATUS::BTM_CMD_STARTED)) {
log::error("BTM_SetEncryption failed btm_status={}", btm_status);
gatt_set_sec_act(p_tcb, GATT_SEC_NONE);
gatt_set_ch_state(p_tcb, GATT_CH_OPEN);
diff --git a/system/stack/include/acl_api.h b/system/stack/include/acl_api.h
index 15371a3077..da657c5550 100644
--- a/system/stack/include/acl_api.h
+++ b/system/stack/include/acl_api.h
@@ -51,7 +51,7 @@ void BTM_acl_after_controller_started();
*
* Description Create and send HCI "Write Link Supervision Timeout" command
*
- * Returns BTM_CMD_STARTED if successfully initiated, otherwise error
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated, otherwise error
*
******************************************************************************/
tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda, uint16_t timeout);
@@ -102,7 +102,7 @@ tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, tHCI_ROLE* p_role);
* peripheral. If role is already set it will do nothing.
*
* Returns tBTM_STATUS::BTM_SUCCESS if already in specified role.
- * BTM_CMD_STARTED if command issued to controller.
+ * tBTM_STATUS::BTM_CMD_STARTED if command issued to controller.
* BTM_NO_RESOURCES if memory couldn't be allocated to issue
* the command
* BTM_UNKNOWN_ADDR if no active link with bd addr specified
@@ -120,7 +120,7 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr);
* The address of link policy results are returned in the
* callback. (tBTM_RSSI_RESULT)
*
- * Returns BTM_CMD_STARTED if command issued to controller.
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if command issued to controller.
* BTM_NO_RESOURCES if memory couldn't be allocated to issue
* the command
* BTM_UNKNOWN_ADDR if no active link with bd addr specified
@@ -138,7 +138,7 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb);
* The result is returned in the callback.
* (tBTM_FAILED_CONTACT_COUNTER_RESULT)
*
- * Returns BTM_CMD_STARTED if command issued to controller.
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if command issued to controller.
* BTM_NO_RESOURCES if memory couldn't be allocated to issue
* the command
* BTM_UNKNOWN_ADDR if no active link with bd addr specified
@@ -157,7 +157,7 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL
* are returned in the callback.
* (tBTM_RSSI_RESULT)
*
- * Returns BTM_CMD_STARTED if command issued to controller.
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if command issued to controller.
* BTM_NO_RESOURCES if memory couldn't be allocated to issue
* the command
* BTM_UNKNOWN_ADDR if no active link with bd addr specified
diff --git a/system/stack/include/btm_api.h b/system/stack/include/btm_api.h
index 0501328651..c9953cb2a8 100644
--- a/system/stack/include/btm_api.h
+++ b/system/stack/include/btm_api.h
@@ -68,7 +68,7 @@ void BTM_reset_complete();
*
* Description This function is called to set the local device name.
*
- * Returns BTM_CMD_STARTED if successful, otherwise an error
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successful, otherwise an error
*
******************************************************************************/
[[nodiscard]] tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name);
@@ -106,7 +106,7 @@ void BTM_reset_complete();
* Description Get local device name from controller. Do not use cached
* name (used to get chip-id prior to btm reset complete).
*
- * Returns BTM_CMD_STARTED if successful, otherwise an error
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successful, otherwise an error
*
******************************************************************************/
[[nodiscard]] tBTM_STATUS BTM_ReadLocalDeviceNameFromController(tBTM_CMPL_CB* p_rln_cmpl_cback);
@@ -178,12 +178,12 @@ void BTM_WriteVoiceSettings(uint16_t settings);
*
* Input Params: remote_bda - device address of name to retrieve
* p_cb - callback function called when
- * BTM_CMD_STARTED is returned.
+ * tBTM_STATUS::BTM_CMD_STARTED is returned.
* A pointer to tBTM_REMOTE_DEV_NAME is
* passed to the callback.
*
* Returns
- * BTM_CMD_STARTED is returned if the request was successfully
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully
* sent to HCI.
* tBTM_STATUS::BTM_BUSY if already in progress
* BTM_UNKNOWN_ADDR if device address is bad
@@ -206,7 +206,7 @@ void BTM_WriteVoiceSettings(uint16_t settings);
* Input Params: None
*
* Returns
- * BTM_CMD_STARTED is returned if the request was successfully
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully
* sent to HCI.
* BTM_NO_RESOURCES if resources could not be allocated to
* start the command
@@ -323,7 +323,7 @@ void BTM_WriteVoiceSettings(uint16_t settings);
* tBTM_STATUS::BTM_BUSY if another SCO being set up to
* the same BD address
* BTM_NO_RESOURCES if the max SCO limit has been reached
- * BTM_CMD_STARTED if the connection establishment is started.
+ * tBTM_STATUS::BTM_CMD_STARTED if the connection establishment is started.
* In this case, "*p_sco_inx" is filled in
* with the sco index used for the connection.
*
@@ -338,7 +338,7 @@ void BTM_WriteVoiceSettings(uint16_t settings);
*
* Description This function is called to remove a specific SCO connection.
*
- * Returns BTM_CMD_STARTED if successfully initiated, otherwise error
+ * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated, otherwise error
*
******************************************************************************/
[[nodiscard]] tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx);
diff --git a/system/stack/include/btm_inq.h b/system/stack/include/btm_inq.h
index 9067ae4f74..05dd106975 100644
--- a/system/stack/include/btm_inq.h
+++ b/system/stack/include/btm_inq.h
@@ -66,7 +66,7 @@
* NULL, the application is not notified when
* completed.
* Returns tBTM_STATUS
- * BTM_CMD_STARTED if successfully initiated
+ * tBTM_STATUS::BTM_CMD_STARTED if successfully initiated
* tBTM_STATUS::BTM_BUSY if already in progress
* BTM_ILLEGAL_VALUE if parameter(s) are out of range
* BTM_NO_RESOURCES if could not allocate resources to start
diff --git a/system/stack/include/l2cap_security_interface.h b/system/stack/include/l2cap_security_interface.h
index 8897da11d3..94644e6368 100644
--- a/system/stack/include/l2cap_security_interface.h
+++ b/system/stack/include/l2cap_security_interface.h
@@ -32,7 +32,7 @@ void l2c_pin_code_request(const RawAddress& bd_addr);
void l2cu_resubmit_pending_sec_req(const RawAddress* p_bda);
// Establish ACL link to remote device for Security Manager/Pairing.
-// Returns BTM_CMD_STARTED if already connecting, BTM_NO_RESOURCES if can't
+// Returns tBTM_STATUS::BTM_CMD_STARTED if already connecting, BTM_NO_RESOURCES if can't
// allocate lcb, tBTM_STATUS::BTM_SUCCESS if initiated the connection
tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr);
diff --git a/system/stack/l2cap/l2c_csm.cc b/system/stack/l2cap/l2c_csm.cc
index 275c55dd8b..15e225c38d 100644
--- a/system/stack/l2cap/l2c_csm.cc
+++ b/system/stack/l2cap/l2c_csm.cc
@@ -251,7 +251,7 @@ static void l2c_csm_closed(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) {
/* If sec access does not result in started SEC_COM or COMP_NEG are
* already processed */
if (btm_sec_l2cap_access_req(p_ccb->p_lcb->remote_bd_addr, p_ccb->p_rcb->psm, true,
- &l2c_link_sec_comp, p_ccb) == BTM_CMD_STARTED) {
+ &l2c_link_sec_comp, p_ccb) == tBTM_STATUS::BTM_CMD_STARTED) {
p_ccb->chnl_state = CST_ORIG_W4_SEC_COMP;
}
}
@@ -320,7 +320,7 @@ static void l2c_csm_closed(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) {
p_ccb->chnl_state = CST_TERM_W4_SEC_COMP;
auto status = btm_sec_l2cap_access_req(p_ccb->p_lcb->remote_bd_addr, p_ccb->p_rcb->psm,
false, &l2c_link_sec_comp, p_ccb);
- if (status == BTM_CMD_STARTED) {
+ if (status == tBTM_STATUS::BTM_CMD_STARTED) {
// started the security process, tell the peer to set a longer timer
l2cu_send_peer_connect_rsp(p_ccb, L2CAP_CONN_PENDING, 0);
} else {
diff --git a/system/stack/l2cap/l2c_link.cc b/system/stack/l2cap/l2c_link.cc
index d5384bbb67..a9fef06bc0 100644
--- a/system/stack/l2cap/l2c_link.cc
+++ b/system/stack/l2cap/l2c_link.cc
@@ -473,7 +473,7 @@ void l2c_link_timeout(tL2C_LCB* p_lcb) {
/* Security Manager will take care of disconnecting, state will be
* updated at that time */
start_timeout = false;
- } else if (rc == BTM_CMD_STARTED) {
+ } else if (rc == tBTM_STATUS::BTM_CMD_STARTED) {
p_lcb->link_state = LST_DISCONNECTING;
timeout_ms = L2CAP_LINK_DISCONNECT_TIMEOUT_MS;
} else if (rc == tBTM_STATUS::BTM_SUCCESS) {
@@ -1188,7 +1188,7 @@ tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr) {
tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR);
if (p_lcb && (p_lcb->link_state == LST_CONNECTED || p_lcb->link_state == LST_CONNECTING)) {
log::warn("Connection already exists");
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/* Make sure an L2cap link control block is available */
diff --git a/system/stack/l2cap/l2c_utils.cc b/system/stack/l2cap/l2c_utils.cc
index 666f59c417..dd67155181 100644
--- a/system/stack/l2cap/l2c_utils.cc
+++ b/system/stack/l2cap/l2c_utils.cc
@@ -2157,7 +2157,7 @@ void l2cu_create_conn_br_edr(tL2C_LCB* p_lcb) {
p_lcb->SetLinkRoleAsCentral();
if (get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(
- p_lcb_cur->remote_bd_addr) == BTM_CMD_STARTED) {
+ p_lcb_cur->remote_bd_addr) == tBTM_STATUS::BTM_CMD_STARTED) {
alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_LINK_ROLE_SWITCH_TIMEOUT_MS,
l2c_lcb_timer_timeout, p_lcb);
return;
@@ -2789,7 +2789,7 @@ void l2cu_no_dynamic_ccbs(tL2C_LCB* p_lcb) {
rc = btm_sec_disconnect(p_lcb->Handle(), HCI_ERR_PEER_USER,
"stack::l2cap::l2c_utils::l2cu_no_dynamic_ccbs Idle timer popped");
- if (rc == BTM_CMD_STARTED) {
+ if (rc == tBTM_STATUS::BTM_CMD_STARTED) {
l2cu_process_fixed_disc_cback(p_lcb);
p_lcb->link_state = LST_DISCONNECTING;
timeout_ms = L2CAP_LINK_DISCONNECT_TIMEOUT_MS;
diff --git a/system/stack/rnr/remote_name_request.cc b/system/stack/rnr/remote_name_request.cc
index 15ab0c0d8e..acb938ef38 100644
--- a/system/stack/rnr/remote_name_request.cc
+++ b/system/stack/rnr/remote_name_request.cc
@@ -100,12 +100,12 @@ void btm_inq_remote_name_timer_timeout(void* /* data */) { btm_inq_rmt_name_fail
* Input Params: remote_bda: Remote address to execute RNR
* timeout_ms: Internal timeout to await response
* * p_cb: Callback function called when
- * BTM_CMD_STARTED is returned.
+ * tBTM_STATUS::BTM_CMD_STARTED is returned.
* A pointer to tBTM_REMOTE_DEV_NAME is
* passed to the callback.
*
* Returns
- * BTM_CMD_STARTED is returned if the request was sent to HCI.
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was sent to HCI.
* and the callback will be called.
* BTM_BUSY if already in progress
* BTM_NO_RESOURCES if could not allocate resources to start
@@ -165,7 +165,7 @@ tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda, uint64_t timeout
alarm_set_on_mloop(btm_cb.rnr.remote_name_timer, timeout_ms, btm_inq_remote_name_timer_timeout,
NULL);
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
/*******************************************************************************
@@ -258,12 +258,12 @@ void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn, uint16_t
*
* Input Params: remote_bda - device address of name to retrieve
* p_cb - callback function called when
- * BTM_CMD_STARTED is returned.
+ * tBTM_STATUS::BTM_CMD_STARTED is returned.
* A pointer to tBTM_REMOTE_DEV_NAME is
* passed to the callback.
*
* Returns
- * BTM_CMD_STARTED is returned if the request was successfully
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully
* sent to HCI.
* BTM_BUSY if already in progress
* BTM_UNKNOWN_ADDR if device address is bad
@@ -294,7 +294,7 @@ tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda, tBTM_NAME_CMP
* Input Params: None
*
* Returns
- * BTM_CMD_STARTED is returned if the request was successfully
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully
* sent to HCI.
* BTM_NO_RESOURCES if could not allocate resources to start
* the command
@@ -327,5 +327,5 @@ tBTM_STATUS BTM_CancelRemoteDeviceName(void) {
btm_process_remote_name(&btm_cb.rnr.remname_bda, nullptr, 0, HCI_ERR_UNSPECIFIED);
}
}
- return BTM_CMD_STARTED;
+ return tBTM_STATUS::BTM_CMD_STARTED;
}
diff --git a/system/stack/rnr/remote_name_request.h b/system/stack/rnr/remote_name_request.h
index 3dcc32a2d7..c4d1f0b9e4 100644
--- a/system/stack/rnr/remote_name_request.h
+++ b/system/stack/rnr/remote_name_request.h
@@ -112,7 +112,7 @@ bool BTM_IsRemoteNameKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport);
* timed out.
* transport - transport used to query the remote name
* Returns
- * BTM_CMD_STARTED is returned if the request was successfully
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully
* sent to HCI.
* BTM_BUSY if already in progress
* BTM_UNKNOWN_ADDR if device address is bad
@@ -134,7 +134,7 @@ tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda, tBTM_NAME_CMP
* Input Params: None
*
* Returns
- * BTM_CMD_STARTED is returned if the request was successfully
+ * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully
* sent to HCI.
* BTM_NO_RESOURCES if could not allocate resources to start
* the command
diff --git a/system/stack/smp/smp_act.cc b/system/stack/smp/smp_act.cc
index 676a942568..35c1b67f29 100644
--- a/system/stack/smp/smp_act.cc
+++ b/system/stack/smp/smp_act.cc
@@ -1167,7 +1167,7 @@ void smp_start_enc(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
cmd = btm_ble_start_encrypt(p_cb->pairing_bda, false, NULL);
}
- if (cmd != BTM_CMD_STARTED && cmd != tBTM_STATUS::BTM_BUSY) {
+ if (cmd != tBTM_STATUS::BTM_CMD_STARTED && cmd != tBTM_STATUS::BTM_BUSY) {
tSMP_INT_DATA smp_int_data;
smp_int_data.status = SMP_ENC_FAIL;
smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data);
diff --git a/system/stack/test/btm/stack_btm_inq_test.cc b/system/stack/test/btm/stack_btm_inq_test.cc
index ffee7ad46d..cad4b328d9 100644
--- a/system/stack/test/btm/stack_btm_inq_test.cc
+++ b/system/stack/test/btm/stack_btm_inq_test.cc
@@ -215,7 +215,7 @@ protected:
bluetooth::hci::testing::mock_hci_layer_ = &hci_layer_;
// Start Inquiry
- EXPECT_EQ(BTM_CMD_STARTED, BTM_StartInquiry(btm_inq_results_cb, btm_inq_cmpl_cb));
+ EXPECT_EQ(tBTM_STATUS::BTM_CMD_STARTED, BTM_StartInquiry(btm_inq_results_cb, btm_inq_cmpl_cb));
auto view = hci_layer_.GetCommand(OpCode::INQUIRY);
hci_layer_.IncomingEvent(
InquiryStatusBuilder::Create(bluetooth::hci::ErrorCode::SUCCESS, kNumCommandPackets));
diff --git a/system/test/headless/mode/mode.cc b/system/test/headless/mode/mode.cc
index 6b2fefd176..ac16cc98cd 100644
--- a/system/test/headless/mode/mode.cc
+++ b/system/test/headless/mode/mode.cc
@@ -88,7 +88,7 @@ int do_mode([[maybe_unused]] unsigned int num_loops, [[maybe_unused]] const RawA
pwr_command_t pwr_command;
pwr_result_t result = client.set_typical_sniff(std::move(pwr_command));
LOG_CONSOLE("Sniff mode command sent");
- if (result.btm_status == BTM_CMD_STARTED) {
+ if (result.btm_status == tBTM_STATUS::BTM_CMD_STARTED) {
// This awaits the command status callback
power_mode_callback_t cmd_status = result.cmd_status_future.get();
LOG_CONSOLE("Sniff mode command complete:%s", cmd_status.ToString().c_str());
@@ -109,7 +109,7 @@ int do_mode([[maybe_unused]] unsigned int num_loops, [[maybe_unused]] const RawA
pwr_command_t pwr_command;
pwr_result_t result = client.set_active(std::move(pwr_command));
LOG_CONSOLE("Active mode command sent");
- if (result.btm_status == BTM_CMD_STARTED) {
+ if (result.btm_status == tBTM_STATUS::BTM_CMD_STARTED) {
power_mode_callback_t cmd_status = result.cmd_status_future.get();
LOG_CONSOLE("Active mode command complete:%s", cmd_status.ToString().c_str());
if (cmd_status.status == BTM_PM_STS_PENDING) {
diff --git a/system/test/headless/read/name.cc b/system/test/headless/read/name.cc
index 5452a8201d..06d4df311b 100644
--- a/system/test/headless/read/name.cc
+++ b/system/test/headless/read/name.cc
@@ -53,7 +53,7 @@ int bluetooth::test::headless::Name::Run() {
tBTM_STATUS status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
raw_address, &RemoteNameCallback, BT_TRANSPORT_BR_EDR);
- if (status != BTM_CMD_STARTED) {
+ if (status != tBTM_STATUS::BTM_CMD_STARTED) {
fprintf(stdout, "Failure to start read remote device\n");
return -1;
}