1 /*
2  * Copyright 2023 NXP
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/types.h>
8 #include <stddef.h>
9 #include <zephyr/kernel.h>
10 #include <zephyr/sys/printk.h>
11 
12 #include <zephyr/bluetooth/bluetooth.h>
13 #include <zephyr/bluetooth/audio/tmap.h>
14 
15 #include "tmap_bmr.h"
16 
main(void)17 int main(void)
18 {
19 	int err;
20 
21 	err = bt_enable(NULL);
22 	if (err != 0) {
23 		printk("Bluetooth init failed (err %d)\n", err);
24 		return err;
25 	}
26 
27 	printk("Bluetooth initialized\n");
28 
29 	printk("Initializing TMAP and setting role\n");
30 	err = bt_tmap_register(BT_TMAP_ROLE_BMR);
31 	if (err != 0) {
32 		return err;
33 	}
34 
35 	err = vcp_vol_renderer_init();
36 	if (err != 0) {
37 		return err;
38 	}
39 	printk("VCP initialized\n");
40 
41 	printk("Initializing BAP Broadcast Sink\n");
42 	err = bap_broadcast_sink_init();
43 	if (err != 0) {
44 		return err;
45 	}
46 
47 	printk("Starting BAP Broadcast Sink\n");
48 	err = bap_broadcast_sink_run();
49 	if (err != 0) {
50 		return err;
51 	}
52 
53 	return 0;
54 }
55