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 0d04328023..31c9a07e4b 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 @@ -68,9 +68,9 @@ typedef enum /// Dial type of ESP_HF_DIAL_EVT typedef enum { - ESP_HF_DIAL_MEM = 0, /*!< Dial with a memory position */ + ESP_HF_DIAL_NUM = 0, /*!< Dial with a phone number */ ESP_HF_DIAL_VOIP, /*!< Dial with VoIP */ - ESP_HF_DIAL_NUM, /*!< Dial with a phone number */ + ESP_HF_DIAL_MEM, /*!< Dial with a memory position */ } esp_hf_dial_type_t; /// HFP AG callback parameters diff --git a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_act.c b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_act.c index cc92328267..6bb9de6cc1 100644 --- a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_act.c +++ b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_act.c @@ -785,14 +785,17 @@ void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data) void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data) { #if (BTM_WBS_INCLUDED == TRUE) + UINT16 handle = p_data->api_setcodec.hdr.layer_specific; tBTA_AG_PEER_CODEC codec_type = p_data->api_setcodec.codec; tBTA_AG_VAL val; + val.hdr.handle = handle; + val.num = codec_type; + /* Check if the requested codec type is valid */ if((codec_type != BTA_AG_CODEC_NONE) && (codec_type != BTA_AG_CODEC_CVSD) && (codec_type != BTA_AG_CODEC_MSBC)) { - val.num = codec_type; val.hdr.status = BTA_AG_FAIL_RESOURCES; APPL_TRACE_ERROR("%s error: unsupported codec type %d", __func__, codec_type); (*bta_ag_cb.p_cback)(BTA_AG_WBS_EVT, (tBTA_AG *) &val); @@ -804,11 +807,9 @@ void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data) (codec_type == BTA_AG_CODEC_CVSD)) { p_scb->sco_codec = codec_type; p_scb->codec_updated = TRUE; - val.num = codec_type; val.hdr.status = BTA_AG_SUCCESS; APPL_TRACE_DEBUG("%s: Updated codec type %d", __func__, codec_type); } else { - val.num = codec_type; val.hdr.status = BTA_AG_FAIL_RESOURCES; APPL_TRACE_ERROR("%s error: unsupported codec type %d",__func__, codec_type); } 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 baf9e18b31..c0317949f0 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 @@ -134,12 +134,12 @@ do { hf_local_param[idx].btc_hf_cb.num_active = 0; \ hf_local_param[idx].btc_hf_cb.num_held = 0; -#define CHECK_HF_IDX(idx) \ -do { \ - if ((idx < 0) || (idx >= BTC_HF_NUM_CB)) { \ - BTC_TRACE_ERROR("%s: Invalid index %d", __FUNCTION__, idx); \ - return; \ - } \ +#define CHECK_HF_IDX(idx) \ +do { \ + if ((idx < 0) || (idx >= BTC_HF_NUM_CB)) { \ + BTC_TRACE_ERROR("%s:%d Invalid index %d", __FUNCTION__, __LINE__, idx); \ + return; \ + } \ } while (0) /************************************************************************************