Bluetooth: Controller: Allow resolving list update during passive scan
Allow resolving list update when passive scanning, otherwise deny if advertising, active scanning, initiating or periodic sync create is active. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
bbe8fe721b
commit
e0ac70ad91
|
@ -1014,8 +1014,12 @@ static int rl_access_check(bool check_ar)
|
|||
}
|
||||
}
|
||||
|
||||
/* NOTE: Allowed when passive scanning, otherwise deny if advertising,
|
||||
* active scanning, initiating or periodic sync create is active.
|
||||
*/
|
||||
return ((IS_ENABLED(CONFIG_BT_BROADCASTER) && ull_adv_is_enabled(0)) ||
|
||||
(IS_ENABLED(CONFIG_BT_OBSERVER) && ull_scan_is_enabled(0)))
|
||||
(IS_ENABLED(CONFIG_BT_OBSERVER) &&
|
||||
(ull_scan_is_enabled(0) & ~BIT(0))))
|
||||
? 0 : 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -618,18 +618,29 @@ uint32_t ull_scan_is_enabled(uint8_t handle)
|
|||
{
|
||||
struct ll_scan_set *scan;
|
||||
|
||||
scan = ull_scan_is_enabled_get(handle);
|
||||
if (!scan) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* NOTE: BIT(0) - passive scanning enabled
|
||||
* BIT(1) - active scanning enabled
|
||||
* BIT(2) - initiator enabled
|
||||
* BIT(3) - periodic sync create active
|
||||
*/
|
||||
|
||||
scan = ull_scan_is_enabled_get(handle);
|
||||
if (!scan) {
|
||||
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
|
||||
scan = ull_scan_set_get(handle);
|
||||
|
||||
return scan->per_scan.sync ? BIT(3) : 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
return (((uint32_t)scan->is_enabled << scan->lll.type) |
|
||||
#if defined(CONFIG_BT_CENTRAL)
|
||||
(scan->lll.conn ? BIT(2) : 0) |
|
||||
#endif
|
||||
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
|
||||
(scan->per_scan.sync ? BIT(3) : 0) |
|
||||
#endif
|
||||
0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue