mirror of
https://github.com/espressif/esp-idf
synced 2025-04-01 20:30:09 -04:00
Remove btc_hf_idx_by_bdaddr in both btc_hf_init and btc_hf_deinit functions
This commit is contained in:
parent
b257ad7d9e
commit
8e7f7dfe59
@ -300,12 +300,15 @@ bt_status_t btc_hf_execute_service(BOOLEAN b_enable)
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
bt_status_t btc_hf_init(bt_bdaddr_t *bd_addr)
|
bt_status_t btc_hf_init(bt_bdaddr_t *bd_addr)
|
||||||
{
|
{
|
||||||
|
int idx = 0;
|
||||||
|
UNUSED(bd_addr);
|
||||||
|
|
||||||
#if HFP_DYNAMIC_MEMORY == TRUE
|
#if HFP_DYNAMIC_MEMORY == TRUE
|
||||||
if ((hf_local_param = (hf_local_param_t *)osi_malloc(sizeof(hf_local_param_t) * BTC_HF_NUM_CB)) == NULL) {
|
if ((hf_local_param = (hf_local_param_t *)osi_malloc(sizeof(hf_local_param_t) * BTC_HF_NUM_CB)) == NULL) {
|
||||||
return BT_STATUS_FAIL;
|
return BT_STATUS_FAIL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int idx = btc_hf_idx_by_bdaddr(bd_addr);
|
|
||||||
BTC_TRACE_DEBUG("%s - max_hf_clients=%d", __func__, btc_max_hf_clients);
|
BTC_TRACE_DEBUG("%s - max_hf_clients=%d", __func__, btc_max_hf_clients);
|
||||||
/* Invoke the enable service API to the core to set the appropriate service_id
|
/* Invoke the enable service API to the core to set the appropriate service_id
|
||||||
* Internally, the HSP_SERVICE_ID shall also be enabled if HFP is enabled (phone)
|
* Internally, the HSP_SERVICE_ID shall also be enabled if HFP is enabled (phone)
|
||||||
@ -331,7 +334,8 @@ bt_status_t btc_hf_init(bt_bdaddr_t *bd_addr)
|
|||||||
|
|
||||||
void btc_hf_deinit(bt_bdaddr_t *bd_addr)
|
void btc_hf_deinit(bt_bdaddr_t *bd_addr)
|
||||||
{
|
{
|
||||||
int idx = btc_hf_idx_by_bdaddr(bd_addr);
|
UNUSED(bd_addr);
|
||||||
|
|
||||||
BTC_TRACE_EVENT("%s", __FUNCTION__);
|
BTC_TRACE_EVENT("%s", __FUNCTION__);
|
||||||
btc_dm_disable_service(BTA_HFP_SERVICE_ID);
|
btc_dm_disable_service(BTA_HFP_SERVICE_ID);
|
||||||
#if HFP_DYNAMIC_MEMORY == TRUE
|
#if HFP_DYNAMIC_MEMORY == TRUE
|
||||||
@ -340,7 +344,7 @@ void btc_hf_deinit(bt_bdaddr_t *bd_addr)
|
|||||||
hf_local_param = NULL;
|
hf_local_param = NULL;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
hf_local_param[idx].btc_hf_cb.initialized = false;
|
hf_local_param[0].btc_hf_cb.initialized = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user