From 2c3d9ae5dedae13add8ad539e13681220a81e782 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Wed, 6 Mar 2024 18:08:51 +0800 Subject: [PATCH] fix(ble/bluedroid): Fixed BLE BLE periodic advertising parameter check --- components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c b/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c index 1b474ae270..78711b589c 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c @@ -798,8 +798,13 @@ tBTM_STATUS BTM_BlePeriodicAdvCreateSync(tBTM_BLE_Periodic_Sync_Params *params) || (params->reports_disabled > 0x01) || (params->filter_duplicates > 0x01) #endif - || (params->addr_type > 0x01) || - (params->sid > 0xf) || (params->skip > 0x01F3)) { + /*If the Periodic Advertiser List is not used, + the Advertising_SID, Advertiser Address_Type, and Advertiser Address + parameters specify the periodic advertising device to listen to; otherwise they + shall be ignored.*/ + || (params->filter_policy == 0 && params->addr_type > 0x01) + || (params->filter_policy == 0 && params->sid > 0xf) + || (params->skip > 0x01F3)) { status = BTM_ILLEGAL_VALUE; BTM_TRACE_ERROR("%s, The sync parameters is invalid.", __func__); goto end;