From 1ee2c4db758f3f54880fc0ee5115c7a173762c67 Mon Sep 17 00:00:00 2001 From: "wanglai@espressif.com" Date: Mon, 21 Aug 2023 17:43:00 +0800 Subject: [PATCH] fix(bt/bluedroid): Fix the process of sending OK in ATD and COPS cmds --- components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h | 3 +++ components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c | 1 - components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h b/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h index 4a4f50f387..c5b4a1f83c 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h @@ -605,6 +605,9 @@ esp_err_t esp_bt_hf_reject_call(esp_bd_addr_t remote_addr, int num_active, int n * * @brief Initiate a call from AG. * As a precondition to use this API, Service Level Connection shall exist with HFP client. + * If the AG is driven by the HF to call esp_hf_ag_out_call, it needs to response an OK or ERROR + * to HF. But if the AG is actively calling esp_hf_ag_out_call, it does not need to take a response + * to HF. * * @param[in] remote_addr: remote bluetooth device address * @param[in] num_active: the number of active call diff --git a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c index 35ea99e747..e4b0656f56 100644 --- a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c +++ b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c @@ -1522,7 +1522,6 @@ void bta_ag_hfp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result) if (p_result->data.ok_flag != BTA_AG_OK_ERROR) { if (p_result->data.str[0] != 0) { bta_ag_send_result(p_scb, code, p_result->data.str, 0); - bta_ag_send_ok(p_scb); } if (p_result->data.ok_flag == BTA_AG_OK_DONE) { bta_ag_send_ok(p_scb); diff --git a/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c b/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c index db7b4fbc46..842ad01245 100644 --- a/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c +++ b/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c @@ -1479,7 +1479,6 @@ void btc_hf_cb_handler(btc_msg_t *msg) param.out_call.num_or_loc = osi_malloc((strlen(p_data->val.str) + 1) * sizeof(char)); sprintf(param.out_call.num_or_loc, p_data->val.str); btc_hf_cb_to_app(ESP_HF_DIAL_EVT, ¶m); - send_indicator_update(BTA_AG_IND_CALLSETUP,BTA_AG_CALLSETUP_OUTGOING); osi_free(param.out_call.num_or_loc); } else if (event == BTA_AG_AT_BLDN_EVT) { //dial_last memcpy(param.out_call.remote_addr, &hf_local_param[idx].btc_hf_cb.connected_bda,sizeof(esp_bd_addr_t));