Lines Matching refs:scan_state
56 static struct scanner_state scan_state; variable
112 memset(&scan_state, 0x0, sizeof(scan_state)); in bt_scan_reset()
113 k_mutex_init(&scan_state.scan_update_mutex); in bt_scan_reset()
114 k_mutex_init(&scan_state.scan_explicit_params_mutex); in bt_scan_reset()
187 return cmd_le_set_scan_enable(enable, scan_state.used_scan_param.options & in bt_le_scan_set_enable()
338 scan_state.used_scan_param.type == BT_LE_SCAN_TYPE_ACTIVE; in bt_le_scan_active_scanner_running()
345 if (atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { in select_scan_params()
346 memcpy(scan_param, &scan_state.explicit_scan_param, sizeof(*scan_param)); in select_scan_params()
377 if (atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_PER_SYNC) || in select_scan_params()
378 atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN)) { in select_scan_params()
396 return !memcmp(scan_param, &scan_state.used_scan_param, sizeof(*scan_param)); in is_already_using_same_params()
404 if (atomic_get(scan_state.scan_flags) != 0) { in get_scan_action()
432 err = k_mutex_lock(&scan_state.scan_update_mutex, K_NO_WAIT); in scan_update()
453 memset(&scan_state.used_scan_param, 0x0, in scan_update()
454 sizeof(scan_state.used_scan_param)); in scan_update()
470 memcpy(&scan_state.used_scan_param, &scan_param, sizeof(scan_param)); in scan_update()
474 k_mutex_unlock(&scan_state.scan_update_mutex); in scan_update()
482 if (atomic_test_bit(scan_state.scan_flags, flag)) { in scan_check_if_state_allowed()
510 atomic_set_bit(scan_state.scan_flags, flag); in bt_le_scan_user_add()
514 atomic_clear_bit(scan_state.scan_flags, flag); in bt_le_scan_user_add()
527 atomic_clear_bit(scan_state.scan_flags, flag); in bt_le_scan_user_remove()
544 atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { in check_pending_conn()
632 atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN) && in le_adv_recv()
783 if (!atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { in bt_hci_le_adv_ext_report()
1646 if (!atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { in bt_hci_le_adv_report()
1752 err = k_mutex_lock(&scan_state.scan_explicit_params_mutex, K_NO_WAIT); in bt_le_scan_start()
1761 k_mutex_unlock(&scan_state.scan_explicit_params_mutex); in bt_le_scan_start()
1766 memcpy(&scan_state.explicit_scan_param, param, in bt_le_scan_start()
1767 sizeof(scan_state.explicit_scan_param)); in bt_le_scan_start()
1771 k_mutex_unlock(&scan_state.scan_explicit_params_mutex); in bt_le_scan_start()
2415 return atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); in bt_le_explicit_scanner_running()
2420 if (scan_state.explicit_scan_param.window != create_param->window || in bt_le_explicit_scanner_uses_same_params()
2421 scan_state.explicit_scan_param.interval != create_param->interval){ in bt_le_explicit_scanner_uses_same_params()
2425 if (scan_state.explicit_scan_param.options & BT_LE_SCAN_OPT_CODED) { in bt_le_explicit_scanner_uses_same_params()
2426 if (scan_state.explicit_scan_param.window_coded != create_param->window_coded || in bt_le_explicit_scanner_uses_same_params()
2427 scan_state.explicit_scan_param.interval_coded != create_param->interval_coded){ in bt_le_explicit_scanner_uses_same_params()