Bluetooth: Controller: Use defines for scanning state types
Use defines for scanning state types of passive, active, initiator and synchronization state. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
e0ac70ad91
commit
ad36dcdf15
|
@ -1019,7 +1019,7 @@ static int rl_access_check(bool check_ar)
|
||||||
*/
|
*/
|
||||||
return ((IS_ENABLED(CONFIG_BT_BROADCASTER) && ull_adv_is_enabled(0)) ||
|
return ((IS_ENABLED(CONFIG_BT_BROADCASTER) && ull_adv_is_enabled(0)) ||
|
||||||
(IS_ENABLED(CONFIG_BT_OBSERVER) &&
|
(IS_ENABLED(CONFIG_BT_OBSERVER) &&
|
||||||
(ull_scan_is_enabled(0) & ~BIT(0))))
|
(ull_scan_is_enabled(0) & ~ULL_SCAN_IS_PASSIVE)))
|
||||||
? 0 : 1;
|
? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -618,31 +618,25 @@ uint32_t ull_scan_is_enabled(uint8_t handle)
|
||||||
{
|
{
|
||||||
struct ll_scan_set *scan;
|
struct ll_scan_set *scan;
|
||||||
|
|
||||||
/* 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);
|
scan = ull_scan_is_enabled_get(handle);
|
||||||
if (!scan) {
|
if (!scan) {
|
||||||
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
|
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
|
||||||
scan = ull_scan_set_get(handle);
|
scan = ull_scan_set_get(handle);
|
||||||
|
|
||||||
return scan->per_scan.sync ? BIT(3) : 0;
|
return scan->per_scan.sync ? ULL_SCAN_IS_SYNC : 0U;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0U;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return (((uint32_t)scan->is_enabled << scan->lll.type) |
|
return (((uint32_t)scan->is_enabled << scan->lll.type) |
|
||||||
#if defined(CONFIG_BT_CENTRAL)
|
#if defined(CONFIG_BT_CENTRAL)
|
||||||
(scan->lll.conn ? BIT(2) : 0) |
|
(scan->lll.conn ? ULL_SCAN_IS_INITIATOR : 0U) |
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
|
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
|
||||||
(scan->per_scan.sync ? BIT(3) : 0) |
|
(scan->per_scan.sync ? ULL_SCAN_IS_SYNC : 0U) |
|
||||||
#endif
|
#endif
|
||||||
0);
|
0U);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ull_scan_filter_pol_get(uint8_t handle)
|
uint32_t ull_scan_filter_pol_get(uint8_t handle)
|
||||||
|
|
|
@ -62,6 +62,10 @@ struct ll_scan_set *ull_scan_is_enabled_get(uint8_t handle);
|
||||||
struct ll_scan_set *ull_scan_is_disabled_get(uint8_t handle);
|
struct ll_scan_set *ull_scan_is_disabled_get(uint8_t handle);
|
||||||
|
|
||||||
/* Return flags if enabled */
|
/* Return flags if enabled */
|
||||||
|
#define ULL_SCAN_IS_PASSIVE BIT(0)
|
||||||
|
#define ULL_SCAN_IS_ACTIVE BIT(1)
|
||||||
|
#define ULL_SCAN_IS_INITIATOR BIT(2)
|
||||||
|
#define ULL_SCAN_IS_SYNC BIT(3)
|
||||||
uint32_t ull_scan_is_enabled(uint8_t handle);
|
uint32_t ull_scan_is_enabled(uint8_t handle);
|
||||||
|
|
||||||
/* Return filter policy used */
|
/* Return filter policy used */
|
||||||
|
|
Loading…
Reference in a new issue