From 0167b1441197428b0b70c4d851e9ed2211f0bfad Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Mon, 21 Aug 2023 10:10:43 +0800 Subject: [PATCH] fix(bt/bluedroid): Fixed wrong code logic in 'AT+CIND?' of HFP --- .../bluedroid/api/include/api/esp_hf_ag_api.h | 13 -------- .../btc/profile/std/hf_ag/btc_hf_ag.c | 33 +------------------ 2 files changed, 1 insertion(+), 45 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 20b0221556..153ced24f0 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 @@ -116,19 +116,6 @@ typedef union char *unat; /*!< Unknown AT command string */ }unat_rep; /*!< AG callback param of ESP_HF_UNAT_RESPONSE_EVT */ - /** - * @brief ESP_HF_CIND_RESPONSE_EVT - */ - struct hf_cind_param { - esp_hf_call_status_t call_status; /*!< call status indicator */ - esp_hf_call_setup_status_t call_setup_status; /*!< call setup status indicator */ - esp_hf_network_state_t svc; /*!< bluetooth proprietary call hold status indicator */ - int signal_strength; /*!< bluetooth proprietary call hold status indicator */ - esp_hf_roaming_status_t roam; /*!< bluetooth proprietary call hold status indicator */ - int battery_level; /*!< battery charge value, ranges from 0 to 5 */ - esp_hf_call_held_status_t call_held_status; /*!< bluetooth proprietary call hold status indicator */ - } cind; /*!< AG callback param of ESP_HF_CIND_RESPONSE_EVT */ - /** * @brief ESP_HF_DIAL_EVT */ 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 ee74e28bce..bc0efb6afe 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 @@ -214,37 +214,6 @@ static void send_indicator_update(UINT16 indicator, UINT16 value) BTA_AgResult(BTA_AG_HANDLE_ALL, BTA_AG_IND_RES, &ag_res); } -static void btc_hf_cind_evt(tBTA_AG_IND *ind) -{ - esp_hf_cb_param_t param; - memset(¶m, 0, sizeof(esp_hf_cb_param_t)); - - switch (ind->type) { - case BTA_AG_IND_CALL: - param.cind.call_status = ind->value; - break; - case BTA_AG_IND_CALLSETUP: - param.cind.call_setup_status = ind->value; - break; - case BTA_AG_IND_SERVICE: - param.cind.svc = ind->value; - break; - case BTA_AG_IND_SIGNAL: - param.cind.signal_strength = ind->value; - break; - case BTA_AG_IND_ROAM: - param.cind.roam = ind->value; - break; - case BTA_AG_IND_BATTCHG: - param.cind.battery_level = ind->value; - break; - case BTA_AG_IND_CALLHELD: - param.cind.call_held_status = ind->value; - break; - } - btc_hf_cb_to_app(ESP_HF_CIND_RESPONSE_EVT, ¶m); -} - static void bte_hf_evt(tBTA_AG_EVT event, tBTA_AG *param) { int param_len = 0; @@ -1407,7 +1376,7 @@ void btc_hf_cb_handler(btc_msg_t *msg) case BTA_AG_AT_CIND_EVT: { - btc_hf_cind_evt(&p_data->ind); + btc_hf_cb_to_app(ESP_HF_CIND_RESPONSE_EVT, NULL); break; }