1 /**
2  * Common functions and helpers for BSIM GATT tests
3  *
4  * Copyright (c) 2022 Nordic Semiconductor ASA
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 #include "bs_tracing.h"
10 #include "bs_types.h"
11 #include "bstests.h"
12 #include "time_machine.h"
13 #include <zephyr/sys/__assert.h>
14 
15 #include <errno.h>
16 #include <stddef.h>
17 #include <stdint.h>
18 
19 #include <zephyr/bluetooth/bluetooth.h>
20 #include <zephyr/bluetooth/conn.h>
21 #include <zephyr/bluetooth/gatt.h>
22 #include <zephyr/bluetooth/hci.h>
23 #include <zephyr/bluetooth/uuid.h>
24 #include <zephyr/kernel.h>
25 #include <zephyr/types.h>
26 
27 #include "babblekit/testcase.h"
28 #include "babblekit/flags.h"
29 
30 DECLARE_FLAG(flag_pairing_complete);
31 DECLARE_FLAG(flag_pairing_failed);
32 
33 extern struct bt_conn *g_conn;
34 void wait_connected(void);
35 void wait_disconnected(void);
36 void clear_g_conn(void);
37 void bs_bt_utils_setup(void);
38 void scan_connect_to_first_result(void);
39 void disconnect(void);
40 void set_security(bt_security_t sec);
41 void advertise_connectable(int id, bt_addr_le_t *directed_dst);
42