]> granicus.if.org Git - esp-idf/commitdiff
Component/bt: add scan window and interval check when set scan params
authorzhiweijian <zhiweijian@espressif.com>
Tue, 30 Oct 2018 03:08:49 +0000 (11:08 +0800)
committerbot <bot@espressif.com>
Tue, 6 Nov 2018 08:45:25 +0000 (08:45 +0000)
components/bt/bluedroid/stack/btm/btm_ble_gap.c

index a3d4b85126d35861095ed03aeef2159200f77d27..8d7ecdaac053061987f3f79386721326314e693d 100644 (file)
@@ -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;