1 /* btp_ascs.h - Bluetooth tester headers */
2 
3 /*
4  * Copyright (c) 2023 Codecoup
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 /* ASCS commands */
10 #define BTP_ASCS_READ_SUPPORTED_COMMANDS	0x01
11 struct btp_ascs_read_supported_commands_rp {
12 	uint8_t data[0];
13 } __packed;
14 
15 #define BTP_ASCS_CONFIGURE_CODEC	0x02
16 struct btp_ascs_configure_codec_cmd {
17 	bt_addr_le_t address;
18 	uint8_t ase_id;
19 	uint8_t coding_format;
20 	uint16_t vid;
21 	uint16_t cid;
22 	uint8_t cc_ltvs_len;
23 	uint8_t cc_ltvs[0];
24 } __packed;
25 
26 #define BTP_ASCS_CONFIGURE_QOS	0x03
27 struct btp_ascs_configure_qos_cmd {
28 	bt_addr_le_t address;
29 	uint8_t ase_id;
30 	uint8_t cig_id;
31 	uint8_t cis_id;
32 	uint8_t sdu_interval[3];
33 	uint8_t framing;
34 	uint16_t max_sdu;
35 	uint8_t retransmission_num;
36 	uint16_t max_transport_latency;
37 	uint8_t presentation_delay[3];
38 } __packed;
39 
40 #define BTP_ASCS_ENABLE	0x04
41 struct btp_ascs_enable_cmd {
42 	bt_addr_le_t address;
43 	uint8_t ase_id;
44 } __packed;
45 
46 #define BTP_ASCS_RECEIVER_START_READY	0x05
47 struct btp_ascs_receiver_start_ready_cmd {
48 	bt_addr_le_t address;
49 	uint8_t ase_id;
50 } __packed;
51 
52 #define BTP_ASCS_RECEIVER_STOP_READY	0x06
53 struct btp_ascs_receiver_stop_ready_cmd {
54 	bt_addr_le_t address;
55 	uint8_t ase_id;
56 } __packed;
57 
58 #define BTP_ASCS_DISABLE	0x07
59 struct btp_ascs_disable_cmd {
60 	bt_addr_le_t address;
61 	uint8_t ase_id;
62 } __packed;
63 
64 #define BTP_ASCS_RELEASE	0x08
65 struct btp_ascs_release_cmd {
66 	bt_addr_le_t address;
67 	uint8_t ase_id;
68 } __packed;
69 
70 #define BTP_ASCS_UPDATE_METADATA	0x09
71 struct btp_ascs_update_metadata_cmd {
72 	bt_addr_le_t address;
73 	uint8_t ase_id;
74 } __packed;
75 
76 #define BTP_ASCS_ADD_ASE_TO_CIS		0x0a
77 struct btp_ascs_add_ase_to_cis {
78 	bt_addr_le_t address;
79 	uint8_t ase_id;
80 	uint8_t cig_id;
81 	uint8_t cis_id;
82 } __packed;
83 
84 #define BTP_ASCS_PRECONFIGURE_QOS	0x0b
85 struct btp_ascs_preconfigure_qos_cmd {
86 	uint8_t cig_id;
87 	uint8_t cis_id;
88 	uint8_t sdu_interval[3];
89 	uint8_t framing;
90 	uint16_t max_sdu;
91 	uint8_t retransmission_num;
92 	uint16_t max_transport_latency;
93 	uint8_t presentation_delay[3];
94 } __packed;
95 
96 /* ASCS events */
97 #define BTP_ASCS_EV_OPERATION_COMPLETED	0x80
98 struct btp_ascs_operation_completed_ev {
99 	bt_addr_le_t address;
100 	uint8_t ase_id;
101 	uint8_t opcode;
102 	uint8_t status;
103 
104 	/* RFU */
105 	uint8_t flags;
106 } __packed;
107 
108 #define BTP_ASCS_EV_CHARACTERISTIC_SUBSCRIBED 0x81
109 
110 #define BTP_ASCS_EV_ASE_STATE_CHANGED	0x82
111 struct btp_ascs_ase_state_changed_ev {
112 	bt_addr_le_t address;
113 	uint8_t ase_id;
114 	uint8_t state;
115 } __packed;
116 
117 #define BTP_ASCS_STATUS_SUCCESS	0x00
118 #define BTP_ASCS_STATUS_FAILED	0x01
119