From fd33d4cfa7d69888dcc1a3cbc9fbee041d84c616 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Tue, 12 Nov 2024 19:33:24 +0800 Subject: [PATCH] fix(bt/bluedroid): Fixed LE channel selection algorithm event reporting --- .../bt/host/bluedroid/stack/btu/btu_hcif.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/bt/host/bluedroid/stack/btu/btu_hcif.c b/components/bt/host/bluedroid/stack/btu/btu_hcif.c index ed9b947b9c..e5e20011ae 100644 --- a/components/bt/host/bluedroid/stack/btu/btu_hcif.c +++ b/components/bt/host/bluedroid/stack/btu/btu_hcif.c @@ -143,6 +143,7 @@ static void btu_ble_periodic_adv_sync_lost_evt(UINT8 *p); static void btu_ble_scan_timeout_evt(UINT8 *p); static void btu_ble_adv_set_terminate_evt(UINT8 *p); static void btu_ble_scan_req_received_evt(UINT8 *p); +static void btu_ble_channel_select_alg_evt(UINT8 *p); #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) static void btu_ble_periodic_adv_sync_trans_recv(UINT8 *p); @@ -411,6 +412,7 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg) btu_ble_scan_req_received_evt(p); break; case HCI_BLE_CHANNEL_SELECT_ALG: + btu_ble_channel_select_alg_evt(p); break; #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) @@ -2341,6 +2343,21 @@ static void btu_ble_scan_req_received_evt(UINT8 *p) btm_ble_scan_req_received_evt(&req_received); } + +static void btu_ble_channel_select_alg_evt(UINT8 *p) +{ + tBTM_BLE_CHANNEL_SEL_ALG chan_sel_alg = {0}; + + if (!p) { + HCI_TRACE_ERROR("%s, Invalid params.", __func__); + return; + } + + STREAM_TO_UINT16(chan_sel_alg.conn_handle, p); + STREAM_TO_UINT8(chan_sel_alg.channel_sel_alg, p); + + btm_ble_channel_select_algorithm_evt(&chan_sel_alg); +} #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)