1 /** @file
2  *  @brief Internal APIs for Bluetooth MICP.
3  */
4 
5 /*
6  * Copyright (c) 2020 Bose Corporation
7  * Copyright (c) 2020 Nordic Semiconductor ASA
8  *
9  * SPDX-License-Identifier: Apache-2.0
10  */
11 
12 #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_
13 #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_
14 
15 #include <stdbool.h>
16 #include <stdint.h>
17 
18 #include <zephyr/autoconf.h>
19 #include <zephyr/bluetooth/conn.h>
20 #include <zephyr/bluetooth/gatt.h>
21 #include <zephyr/sys/atomic.h>
22 
23 enum bt_micp_mic_ctlr_flag {
24 	BT_MICP_MIC_CTLR_FLAG_BUSY,
25 
26 	BT_MICP_MIC_CTLR_FLAG_NUM_FLAGS, /* keep as last */
27 };
28 
29 struct bt_micp_mic_ctlr {
30 	uint16_t start_handle;
31 	uint16_t end_handle;
32 	uint16_t mute_handle;
33 	struct bt_gatt_subscribe_params mute_sub_params;
34 	struct bt_gatt_discover_params mute_sub_disc_params;
35 
36 	uint8_t mute_val_buf[1]; /* Mute value is a single octet */
37 	struct bt_gatt_write_params write_params;
38 	struct bt_gatt_read_params read_params;
39 	struct bt_gatt_discover_params discover_params;
40 	struct bt_conn *conn;
41 
42 #if defined(CONFIG_BT_MICP_MIC_CTLR_AICS)
43 	uint8_t aics_inst_cnt;
44 	struct bt_aics *aics[CONFIG_BT_MICP_MIC_CTLR_MAX_AICS_INST];
45 #endif /* CONFIG_BT_MICP_MIC_CTLR_AICS */
46 
47 	ATOMIC_DEFINE(flags, BT_MICP_MIC_CTLR_FLAG_NUM_FLAGS);
48 };
49 
50 #endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_ */
51