1 /**
2  * @file
3  * @brief Internal APIs for Bluetooth CSIP
4  *
5  * Copyright (c) 2021-2022 Nordic Semiconductor ASA
6  *
7  * SPDX-License-Identifier: Apache-2.0
8  */
9 
10 #include <stdint.h>
11 
12 #include <zephyr/bluetooth/audio/csip.h>
13 #include <zephyr/bluetooth/conn.h>
14 #include <zephyr/bluetooth/gatt.h>
15 
16 #define BT_CSIP_SIRK_TYPE_ENCRYPTED             0x00
17 #define BT_CSIP_SIRK_TYPE_PLAIN                 0x01
18 
19 #define BT_CSIP_RELEASE_VALUE                   0x01
20 #define BT_CSIP_LOCK_VALUE                      0x02
21 
22 struct bt_csip_sirk {
23 	uint8_t type;
24 	uint8_t value[BT_CSIP_SIRK_SIZE];
25 } __packed;
26 
27 struct bt_csip_set_coordinator_svc_inst *bt_csip_set_coordinator_lookup_instance_by_index(
28 	const struct bt_conn *conn, uint8_t idx);
29 
30 struct bt_csip_set_coordinator_svc_inst {
31 	uint8_t set_lock;
32 
33 	uint16_t start_handle;
34 	uint16_t end_handle;
35 	uint16_t sirk_handle;
36 	uint16_t set_size_handle;
37 	uint16_t set_lock_handle;
38 	uint16_t rank_handle;
39 
40 	uint8_t idx;
41 	struct bt_gatt_subscribe_params sirk_sub_params;
42 	struct bt_gatt_discover_params sirk_sub_disc_params;
43 	struct bt_gatt_subscribe_params size_sub_params;
44 	struct bt_gatt_discover_params size_sub_disc_params;
45 	struct bt_gatt_subscribe_params lock_sub_params;
46 	struct bt_gatt_discover_params lock_sub_disc_params;
47 
48 	struct bt_conn *conn;
49 	struct bt_csip_set_coordinator_set_info *set_info;
50 };
51 
52 struct bt_csip_set_coordinator_csis_inst *
53 bt_csip_set_coordinator_csis_inst_by_handle(struct bt_conn *conn, uint16_t start_handle);
54