mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(ble/bluedroid): Optimize BLE stack connect callback name
This commit is contained in:
parent
f2cfe4a0f0
commit
bc1851d793
@ -70,7 +70,7 @@ static tBTM_BLE_VSC_CB *cmn_ble_gap_vsc_cb_ptr;
|
||||
static tBTM_BLE_CTRL_FEATURES_CBACK *p_ctrl_le_feature_rd_cmpl_cback = NULL;
|
||||
#endif
|
||||
|
||||
tBTM_CallbackFunc conn_param_update_cb;
|
||||
tBTM_CallbackFunc conn_callback_func;
|
||||
/*******************************************************************************
|
||||
** Local functions
|
||||
*******************************************************************************/
|
||||
@ -309,7 +309,7 @@ void btm_ble_sem_free(void)
|
||||
*******************************************************************************/
|
||||
void BTM_BleRegiseterConnParamCallback(tBTM_UPDATE_CONN_PARAM_CBACK *update_conn_param_cb)
|
||||
{
|
||||
conn_param_update_cb.update_conn_param_cb = update_conn_param_cb;
|
||||
conn_callback_func.update_conn_param_cb = update_conn_param_cb;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@ -323,7 +323,7 @@ void BTM_BleRegiseterConnParamCallback(tBTM_UPDATE_CONN_PARAM_CBACK *update_conn
|
||||
*******************************************************************************/
|
||||
void BTM_BleRegiseterPktLengthChangeCallback(tBTM_SET_PKT_DATA_LENGTH_CBACK *ptk_len_chane_cb)
|
||||
{
|
||||
conn_param_update_cb.set_pkt_data_length_cb = ptk_len_chane_cb;
|
||||
conn_callback_func.set_pkt_data_length_cb = ptk_len_chane_cb;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -974,7 +974,7 @@ typedef struct{
|
||||
tBTM_SET_PKT_DATA_LENGTH_CBACK *set_pkt_data_length_cb;
|
||||
}tBTM_CallbackFunc;
|
||||
|
||||
extern tBTM_CallbackFunc conn_param_update_cb;
|
||||
extern tBTM_CallbackFunc conn_callback_func;
|
||||
/* security action for L2CAP COC channels */
|
||||
#define BTM_SEC_OK 1
|
||||
#define BTM_SEC_ENCRYPT 2 /* encrypt the link with current key */
|
||||
|
@ -175,14 +175,14 @@ BOOLEAN L2CA_UpdateBleConnParams (BD_ADDR rem_bda, UINT16 min_int, UINT16 max_in
|
||||
L2CAP_TRACE_ERROR("There are two connection parameter requests that are being updated, please try later ");
|
||||
}
|
||||
|
||||
if ((need_cb == TRUE) && (conn_param_update_cb.update_conn_param_cb != NULL)) {
|
||||
if ((need_cb == TRUE) && (conn_callback_func.update_conn_param_cb != NULL)) {
|
||||
tBTM_LE_UPDATE_CONN_PRAMS update_param;
|
||||
update_param.max_conn_int = max_int;
|
||||
update_param.min_conn_int = min_int;
|
||||
update_param.conn_int = p_lcb->current_used_conn_interval;
|
||||
update_param.slave_latency = p_lcb->current_used_conn_latency;
|
||||
update_param.supervision_tout = p_lcb->current_used_conn_timeout;
|
||||
(conn_param_update_cb.update_conn_param_cb)(status, p_lcb->remote_bd_addr, &update_param);
|
||||
(conn_callback_func.update_conn_param_cb)(status, p_lcb->remote_bd_addr, &update_param);
|
||||
return (status == HCI_SUCCESS);
|
||||
}
|
||||
|
||||
@ -647,7 +647,7 @@ void l2cble_process_conn_update_evt (UINT16 handle, UINT8 status, UINT16 conn_in
|
||||
p_lcb->conn_update_mask &= ~L2C_BLE_UPDATE_PARAM_FULL;
|
||||
btu_stop_timer(&p_lcb->upda_con_timer);
|
||||
|
||||
if (conn_param_update_cb.update_conn_param_cb != NULL) {
|
||||
if (conn_callback_func.update_conn_param_cb != NULL) {
|
||||
l2c_send_update_conn_params_cb(p_lcb, status);
|
||||
}
|
||||
|
||||
@ -686,7 +686,7 @@ void l2cble_get_conn_param_format_err_from_contoller (UINT8 status, UINT16 handl
|
||||
|
||||
btu_stop_timer (&p_lcb->upda_con_timer);
|
||||
|
||||
if (conn_param_update_cb.update_conn_param_cb != NULL) {
|
||||
if (conn_callback_func.update_conn_param_cb != NULL) {
|
||||
l2c_send_update_conn_params_cb(p_lcb, status);
|
||||
}
|
||||
if ((p_lcb->conn_update_mask & L2C_BLE_UPDATE_PARAM_FULL) != 0){
|
||||
@ -1328,7 +1328,7 @@ void l2cble_process_data_length_change_event(UINT16 handle, UINT16 tx_data_len,
|
||||
(*p_acl->p_set_pkt_data_cback)(BTM_SUCCESS, &data_length_params);
|
||||
} else {
|
||||
// If the callback is not registered,using global callback
|
||||
(*conn_param_update_cb.set_pkt_data_length_cb)(BTM_SUCCESS, &data_length_params);
|
||||
(*conn_callback_func.set_pkt_data_length_cb)(BTM_SUCCESS, &data_length_params);
|
||||
}
|
||||
p_acl->data_len_updating = false;
|
||||
if(p_acl->data_len_waiting) {
|
||||
@ -1399,7 +1399,7 @@ void l2cble_set_fixed_channel_tx_data_length(BD_ADDR remote_bda, UINT16 fix_cid,
|
||||
*******************************************************************************/
|
||||
void l2c_send_update_conn_params_cb(tL2C_LCB *p_lcb, UINT8 status)
|
||||
{
|
||||
if(conn_param_update_cb.update_conn_param_cb != NULL){
|
||||
if(conn_callback_func.update_conn_param_cb != NULL){
|
||||
tBTM_LE_UPDATE_CONN_PRAMS update_param;
|
||||
//if myself update the connection parameters
|
||||
if (p_lcb->updating_param_flag){
|
||||
@ -1415,7 +1415,7 @@ void l2c_send_update_conn_params_cb(tL2C_LCB *p_lcb, UINT8 status)
|
||||
update_param.slave_latency = p_lcb->current_used_conn_latency;
|
||||
update_param.supervision_tout = p_lcb->current_used_conn_timeout;
|
||||
|
||||
(conn_param_update_cb.update_conn_param_cb)(status, p_lcb->remote_bd_addr, &update_param);
|
||||
(conn_callback_func.update_conn_param_cb)(status, p_lcb->remote_bd_addr, &update_param);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user