fix(bt/bluedroid): Fixed wrong code logic in 'AT+CIND?' of HFP

This commit is contained in:
Jin Cheng 2023-08-21 10:10:43 +08:00 committed by BOT
parent 17d1b66d47
commit 0167b14411
2 changed files with 1 additions and 45 deletions

View File

@ -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
*/

View File

@ -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(&param, 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, &param);
}
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;
}