1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <stdint.h>
8 
9 #include <zephyr/logging/log.h>
10 #include <zephyr/bluetooth/addr.h>
11 #include <zephyr/bluetooth/conn.h>
12 #include <zephyr/bluetooth/bluetooth.h>
13 
14 #include "bs_bt_utils.h"
15 
16 LOG_MODULE_REGISTER(test_central, LOG_LEVEL_DBG);
17 
18 BUILD_ASSERT(CONFIG_BT_BONDABLE, "CONFIG_BT_BONDABLE must be enabled by default.");
19 
central(void)20 void central(void)
21 {
22 	LOG_DBG("===== Central =====");
23 
24 	bs_bt_utils_setup();
25 
26 	scan_connect_to_first_result();
27 	wait_connected();
28 	set_security(BT_SECURITY_L2);
29 
30 	TAKE_FLAG(flag_pairing_complete);
31 	TAKE_FLAG(flag_bonded);
32 
33 	LOG_DBG("Wait for disconnection...");
34 	wait_disconnected();
35 
36 	clear_g_conn();
37 
38 	PASS("PASS\n");
39 }
40