Bluetooth: Allow to configure background scan window and interval
Applications may require different scan windows and interval depending on expected re-connection time or peer devices advertising parameters. Default to GAP recommended slow values. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
parent
c0287695fb
commit
063123f35a
2 changed files with 13 additions and 2 deletions
|
@ -389,6 +389,17 @@ endif # BT_GAP_PERIPHERAL_PREF_PARAMS
|
||||||
|
|
||||||
endif # BT_CONN
|
endif # BT_CONN
|
||||||
|
|
||||||
|
if BT_OBSERVER
|
||||||
|
config BT_BACKGROUND_SCAN_INTERVAL
|
||||||
|
int "Scan interval used for background scanning in 0.625 ms units"
|
||||||
|
default 2048
|
||||||
|
range 4 16384
|
||||||
|
config BT_BACKGROUND_SCAN_WINDOW
|
||||||
|
int "Scan window used for background scanning in 0.625 ms units"
|
||||||
|
default 18
|
||||||
|
range 4 16384
|
||||||
|
endif # BT_OBSERVER
|
||||||
|
|
||||||
config BT_SCAN_WITH_IDENTITY
|
config BT_SCAN_WITH_IDENTITY
|
||||||
bool "Perform active scanning using local identity address"
|
bool "Perform active scanning using local identity address"
|
||||||
depends on !BT_PRIVACY && (BT_CENTRAL || BT_OBSERVER)
|
depends on !BT_PRIVACY && (BT_CENTRAL || BT_OBSERVER)
|
||||||
|
|
|
@ -3175,8 +3175,8 @@ int bt_le_scan_update(bool fast_scan)
|
||||||
interval = BT_GAP_SCAN_FAST_INTERVAL;
|
interval = BT_GAP_SCAN_FAST_INTERVAL;
|
||||||
window = BT_GAP_SCAN_FAST_WINDOW;
|
window = BT_GAP_SCAN_FAST_WINDOW;
|
||||||
} else {
|
} else {
|
||||||
interval = BT_GAP_SCAN_SLOW_INTERVAL_1;
|
interval = CONFIG_BT_BACKGROUND_SCAN_INTERVAL;
|
||||||
window = BT_GAP_SCAN_SLOW_WINDOW_1;
|
window = CONFIG_BT_BACKGROUND_SCAN_WINDOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
return start_le_scan(BT_HCI_LE_SCAN_PASSIVE, interval, window);
|
return start_le_scan(BT_HCI_LE_SCAN_PASSIVE, interval, window);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue