From: zhiweijian Date: Tue, 30 Oct 2018 03:08:49 +0000 (+0800) Subject: Component/bt: add scan window and interval check when set scan params X-Git-Tag: v3.2.1~54^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46a3c36343050d2b8cdb347f1659353230a5310a;p=esp-idf Component/bt: add scan window and interval check when set scan params --- diff --git a/components/bt/bluedroid/stack/btm/btm_ble_gap.c b/components/bt/bluedroid/stack/btm/btm_ble_gap.c index 445cf03570..615db8d351 100644 --- a/components/bt/bluedroid/stack/btm/btm_ble_gap.c +++ b/components/bt/bluedroid/stack/btm/btm_ble_gap.c @@ -1526,7 +1526,7 @@ void BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval, UINT32 if (BTM_BLE_ISVALID_PARAM(scan_interval, BTM_BLE_SCAN_INT_MIN, max_scan_interval) && BTM_BLE_ISVALID_PARAM(scan_window, BTM_BLE_SCAN_WIN_MIN, max_scan_window) && (scan_mode == BTM_BLE_SCAN_MODE_ACTI || scan_mode == BTM_BLE_SCAN_MODE_PASS) && - (scan_duplicate_filter < BTM_BLE_SCAN_DUPLICATE_MAX)) { + (scan_duplicate_filter < BTM_BLE_SCAN_DUPLICATE_MAX) && (scan_window <= scan_interval)) { p_cb->scan_type = scan_mode; p_cb->scan_interval = scan_interval; p_cb->scan_window = scan_window;