diff --git a/components/bt/bluedroid/bta/dm/bta_dm_act.c b/components/bt/bluedroid/bta/dm/bta_dm_act.c index 80b4e8e75..8ae727a35 100644 --- a/components/bt/bluedroid/bta/dm/bta_dm_act.c +++ b/components/bt/bluedroid/bta/dm/bta_dm_act.c @@ -2645,7 +2645,7 @@ static UINT8 bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NA return BTM_NOT_AUTHORIZED; } } - + @@ -4338,7 +4338,7 @@ static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_D } else { sec_event.auth_cmpl.success = TRUE; if (!p_data->complt.smp_over_br) { - + } } @@ -4900,25 +4900,26 @@ void bta_dm_ble_set_scan_rsp_raw (tBTA_DM_MSG *p_data) void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data) { tACL_CONN *p_acl_cb = btm_bda_to_acl(p_data->ble_set_data_length.remote_bda, BT_TRANSPORT_LE); - if (p_acl_cb == NULL) { - APPL_TRACE_ERROR("%s error: Invalid connection remote_bda.", __func__); - return; - } else { - p_acl_cb->p_set_pkt_data_cback = p_data->ble_set_data_length.p_set_pkt_data_cback; - } - UINT8 status = BTM_SetBleDataLength(p_data->ble_set_data_length.remote_bda, - p_data->ble_set_data_length.tx_data_length); - if (status != BTM_SUCCESS) { - APPL_TRACE_ERROR("%s failed\n", __FUNCTION__); - if (p_data->ble_set_data_length.p_set_pkt_data_cback) { - if (p_acl_cb->data_length_params.tx_len == 0){ - uint16_t length = controller_get_interface()->get_acl_data_size_ble(); - p_acl_cb->data_length_params.rx_len = length; - p_acl_cb->data_length_params.tx_len = length; - } - (*p_data->ble_set_data_length.p_set_pkt_data_cback)(status, &p_acl_cb->data_length_params); - } + if (p_acl_cb == NULL) { + APPL_TRACE_ERROR("%s error: Invalid connection remote_bda.", __func__); + return; + } else { + p_acl_cb->p_set_pkt_data_cback = p_data->ble_set_data_length.p_set_pkt_data_cback; } + UINT8 status = BTM_SetBleDataLength(p_data->ble_set_data_length.remote_bda, + p_data->ble_set_data_length.tx_data_length); + if (status != BTM_SUCCESS) { + APPL_TRACE_ERROR("%s failed\n", __FUNCTION__); + } + if (p_data->ble_set_data_length.p_set_pkt_data_cback) { + if (p_acl_cb->data_length_params.tx_len == 0){ + uint16_t length = controller_get_interface()->get_acl_data_size_ble(); + p_acl_cb->data_length_params.rx_len = length; + p_acl_cb->data_length_params.tx_len = length; + } + (*p_data->ble_set_data_length.p_set_pkt_data_cback)(status, &p_acl_cb->data_length_params); + } + } /******************************************************************************* @@ -5394,7 +5395,7 @@ static void bta_ble_energy_info_cmpl(tBTM_BLE_TX_TIME_MS tx_time, if (BTA_SUCCESS == st) { ctrl_state = bta_dm_pm_obtain_controller_state(); } -#endif +#endif if (bta_dm_cb.p_energy_info_cback) { bta_dm_cb.p_energy_info_cback(tx_time, rx_time, idle_time, energy_used, ctrl_state, st); }