mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(bt/bluedroid): Fixed wrong code logic in 'AT+CIND?' of HFP
This commit is contained in:
parent
17d1b66d47
commit
0167b14411
@ -116,19 +116,6 @@ typedef union
|
|||||||
char *unat; /*!< Unknown AT command string */
|
char *unat; /*!< Unknown AT command string */
|
||||||
}unat_rep; /*!< AG callback param of ESP_HF_UNAT_RESPONSE_EVT */
|
}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
|
* @brief ESP_HF_DIAL_EVT
|
||||||
*/
|
*/
|
||||||
|
@ -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);
|
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)
|
static void bte_hf_evt(tBTA_AG_EVT event, tBTA_AG *param)
|
||||||
{
|
{
|
||||||
int param_len = 0;
|
int param_len = 0;
|
||||||
@ -1407,7 +1376,7 @@ void btc_hf_cb_handler(btc_msg_t *msg)
|
|||||||
|
|
||||||
case BTA_AG_AT_CIND_EVT:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user