forked from espressif/esp-idf
bt: Deleted some redundant variables in HFP_AG
This commit is contained in:
@ -94,7 +94,7 @@ static void bta_ag_cback_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data, tBTA_AG_
|
|||||||
/* call app callback with open event */
|
/* call app callback with open event */
|
||||||
open.hdr.handle = bta_ag_scb_to_idx(p_scb);
|
open.hdr.handle = bta_ag_scb_to_idx(p_scb);
|
||||||
open.hdr.app_id = p_scb->app_id;
|
open.hdr.app_id = p_scb->app_id;
|
||||||
open.status = status;
|
open.hdr.status = status;
|
||||||
open.service_id = bta_ag_svc_id[p_scb->conn_service];
|
open.service_id = bta_ag_svc_id[p_scb->conn_service];
|
||||||
if (p_data) {
|
if (p_data) {
|
||||||
/* if p_data is provided then we need to pick the bd address from the open api structure */
|
/* if p_data is provided then we need to pick the bd address from the open api structure */
|
||||||
@ -131,7 +131,7 @@ void bta_ag_register(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
|
|||||||
/* call app callback with register event */
|
/* call app callback with register event */
|
||||||
reg.hdr.handle = bta_ag_scb_to_idx(p_scb);
|
reg.hdr.handle = bta_ag_scb_to_idx(p_scb);
|
||||||
reg.hdr.app_id = p_scb->app_id;
|
reg.hdr.app_id = p_scb->app_id;
|
||||||
reg.status = BTA_AG_SUCCESS;
|
reg.hdr.status = BTA_AG_SUCCESS;
|
||||||
(*bta_ag_cb.p_cback)(BTA_AG_REGISTER_EVT, (tBTA_AG *) ®);
|
(*bta_ag_cb.p_cback)(BTA_AG_REGISTER_EVT, (tBTA_AG *) ®);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ static void bta_ag_api_register(tBTA_AG_DATA *p_data)
|
|||||||
APPL_TRACE_DEBUG("bta_ag_api_register: p_scb 0x%08x ", (unsigned int)p_scb);
|
APPL_TRACE_DEBUG("bta_ag_api_register: p_scb 0x%08x ", (unsigned int)p_scb);
|
||||||
bta_ag_sm_execute(p_scb, p_data->hdr.event, p_data);
|
bta_ag_sm_execute(p_scb, p_data->hdr.event, p_data);
|
||||||
} else {
|
} else {
|
||||||
reg.status = BTA_AG_FAIL_RESOURCES;
|
reg.hdr.status = BTA_AG_FAIL_RESOURCES;
|
||||||
(*bta_ag_cb.p_cback)(BTA_AG_REGISTER_EVT, (tBTA_AG *) ®);
|
(*bta_ag_cb.p_cback)(BTA_AG_REGISTER_EVT, (tBTA_AG *) ®);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,8 +333,6 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
tBTA_AG_HDR hdr;
|
tBTA_AG_HDR hdr;
|
||||||
UINT16 handle;
|
|
||||||
tBTA_AG_STATUS status;
|
|
||||||
} tBTA_AG_REGISTER;
|
} tBTA_AG_REGISTER;
|
||||||
|
|
||||||
/* data associated with BTA_AG_OPEN_EVT */
|
/* data associated with BTA_AG_OPEN_EVT */
|
||||||
@ -343,7 +341,6 @@ typedef struct
|
|||||||
tBTA_AG_HDR hdr;
|
tBTA_AG_HDR hdr;
|
||||||
BD_ADDR bd_addr;
|
BD_ADDR bd_addr;
|
||||||
tBTA_SERVICE_ID service_id;
|
tBTA_SERVICE_ID service_id;
|
||||||
tBTA_AG_STATUS status;
|
|
||||||
} tBTA_AG_OPEN;
|
} tBTA_AG_OPEN;
|
||||||
|
|
||||||
/* data associated with BTA_AG_CLOSE_EVT */
|
/* data associated with BTA_AG_CLOSE_EVT */
|
||||||
|
@ -1244,7 +1244,7 @@ void btc_hf_cb_handler(btc_msg_t *msg)
|
|||||||
{
|
{
|
||||||
idx = p_data->hdr.handle - 1;
|
idx = p_data->hdr.handle - 1;
|
||||||
CHECK_HF_IDX(idx);
|
CHECK_HF_IDX(idx);
|
||||||
if (p_data->open.status == BTA_AG_SUCCESS)
|
if (p_data->open.hdr.status == BTA_AG_SUCCESS)
|
||||||
{
|
{
|
||||||
bdcpy(hf_local_param[idx].btc_hf_cb.connected_bda.address, p_data->open.bd_addr);
|
bdcpy(hf_local_param[idx].btc_hf_cb.connected_bda.address, p_data->open.bd_addr);
|
||||||
hf_local_param[idx].btc_hf_cb.connection_state = ESP_HF_CONNECTION_STATE_CONNECTED;
|
hf_local_param[idx].btc_hf_cb.connection_state = ESP_HF_CONNECTION_STATE_CONNECTED;
|
||||||
@ -1255,7 +1255,7 @@ void btc_hf_cb_handler(btc_msg_t *msg)
|
|||||||
hf_local_param[idx].btc_hf_cb.connection_state = ESP_HF_CONNECTION_STATE_DISCONNECTED;
|
hf_local_param[idx].btc_hf_cb.connection_state = ESP_HF_CONNECTION_STATE_DISCONNECTED;
|
||||||
} else {
|
} else {
|
||||||
BTC_TRACE_WARNING("%s: AG open failed, but another device connected. status=%d state=%d connected device=%s", __FUNCTION__,
|
BTC_TRACE_WARNING("%s: AG open failed, but another device connected. status=%d state=%d connected device=%s", __FUNCTION__,
|
||||||
p_data->open.status, hf_local_param[idx].btc_hf_cb.connection_state,
|
p_data->open.hdr.status, hf_local_param[idx].btc_hf_cb.connection_state,
|
||||||
bdaddr_to_string(&hf_local_param[idx].btc_hf_cb.connected_bda, bdstr, sizeof(bdstr)));
|
bdaddr_to_string(&hf_local_param[idx].btc_hf_cb.connected_bda, bdstr, sizeof(bdstr)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1272,7 +1272,7 @@ void btc_hf_cb_handler(btc_msg_t *msg)
|
|||||||
if (hf_local_param[idx].btc_hf_cb.connection_state == ESP_HF_CONNECTION_STATE_DISCONNECTED)
|
if (hf_local_param[idx].btc_hf_cb.connection_state == ESP_HF_CONNECTION_STATE_DISCONNECTED)
|
||||||
bdsetany(hf_local_param[idx].btc_hf_cb.connected_bda.address);
|
bdsetany(hf_local_param[idx].btc_hf_cb.connected_bda.address);
|
||||||
|
|
||||||
if (p_data->open.status != BTA_AG_SUCCESS)
|
if (p_data->open.hdr.status != BTA_AG_SUCCESS)
|
||||||
btc_queue_advance();
|
btc_queue_advance();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user