From: Luiz Augusto von Dentz <[email protected]>
This adds the QoS preset definitions as per BAP specification.
---
src/shared/lc3.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 153 insertions(+)
diff --git a/src/shared/lc3.h b/src/shared/lc3.h
index ae193f9e2fa7..e6b043699bc1 100644
--- a/src/shared/lc3.h
+++ b/src/shared/lc3.h
@@ -155,3 +155,156 @@
#define LC3_CONFIG_48_6 \
LC3_CONFIG_48(LC3_CONFIG_DURATION_10, 155u)
+
+#define LC3_QOS_UNFRAMED 0x00
+#define LC3_QOS_FRAMED 0x01
+
+#define LC3_QOS_UCAST(_frame, _pd, _t_lat, _interval, _lat, _sdu, _rtn) \
+{ \
+ .ucast.cig_id = 0x00, \
+ .ucast.cis_id = 0x00, \
+ .ucast.delay = _pd, \
+ .ucast.target_latency = _t_lat, \
+ .ucast.io_qos.interval = _interval, \
+ .ucast.io_qos.latency = _lat, \
+ .ucast.io_qos.sdu = _sdu, \
+ .ucast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \
+ .ucast.io_qos.rtn = _rtn, \
+}
+
+#define LC3_QOS_UCAST_7_5_UNFRAMED(_pd, _t_lat, _lat, _sdu, _rtn) \
+ LC3_QOS_UCAST(LC3_QOS_UNFRAMED, _pd, _t_lat, 7500u, _lat, _sdu, _rtn)
+
+#define LC3_QOS_UCAST_10_UNFRAMED(_pd, _t_lat, _lat, _sdu, _rtn) \
+ LC3_QOS_UCAST(LC3_QOS_UNFRAMED, _pd, _t_lat, 10000u, _lat, _sdu, _rtn)
+
+#define LC3_QOS_UCAST_FRAMED(_pd, _t_lat, _interval, _lat, _sdu, _rtn) \
+ LC3_QOS_UCAST(LC3_QOS_FRAMED, _pd, _t_lat, _interval, _lat, _sdu, _rtn)
+
+#define LC3_QOS_8_1_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 8u, 26u, 2u)
+
+#define LC3_QOS_8_1_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 26u, 13u)
+
+#define LC3_QOS_8_2_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 10u, 30u, 2u)
+
+#define LC3_QOS_8_2_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 95u, 30u, 13u)
+
+#define LC3_QOS_16_1_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 8u, 30u, 2u)
+
+#define LC3_QOS_16_1_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 30u, 13u)
+
+#define LC3_QOS_16_2_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 10u, 40u, 2u)
+
+#define LC3_QOS_16_2_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 95u, 40u, 13u)
+
+#define LC3_QOS_24_1_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 8u, 45u, 2u)
+
+#define LC3_QOS_24_1_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 45u, 13u)
+
+#define LC3_QOS_24_2_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 10u, 60u, 2u)
+
+#define LC3_QOS_24_2_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 95u, 60u, 13u)
+
+#define LC3_QOS_32_1_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 8u, 60u, 2u)
+
+#define LC3_QOS_32_1_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 60u, 13u)
+
+#define LC3_QOS_32_2_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 10u, 80u, 2u)
+
+#define LC3_QOS_32_2_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 95u, 80u, 13u)
+
+#define LC3_QOS_44_1_1 \
+ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 8163u, 24u, 98u, 5u)
+
+#define LC3_QOS_44_1_2 \
+ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 8163u, 80u, 98u, 13u)
+
+#define LC3_QOS_44_2_1 \
+ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 10884u, 31u, 130u, 5u)
+
+#define LC3_QOS_44_2_2 \
+ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 10884u, 85u, 130u, 13u)
+
+#define LC3_QOS_48_1_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 15u, 75u, 5u)
+
+#define LC3_QOS_48_1_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 75u, 13u)
+
+#define LC3_QOS_48_2_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 20u, 100u, 5u)
+
+#define LC3_QOS_48_2_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 95u, 100u, 13u)
+
+#define LC3_QOS_48_3_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 15u, 90u, 5u)
+
+#define LC3_QOS_48_3_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 90u, 13u)
+
+#define LC3_QOS_48_4_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 20u, 120u, 5u)
+
+#define LC3_QOS_48_4_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 100u, 120u, 13u)
+
+#define LC3_QOS_48_5_1 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 15u, 117u, 5u)
+
+#define LC3_QOS_48_5_2 \
+ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 75u, 117u, 13u)
+
+#define LC3_QOS_48_6_1 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 20u, 155u, 5u)
+
+#define LC3_QOS_48_6_2 \
+ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \
+ 100u, 155u, 13u)
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
4.8.4 Unicast Client Initiates Config QoS – Vendor-Specific (Page 46)
Test Purpose:
Verify that a Unicast Client IUT can initiate a Config QoS operation for a
vendor-specific codec.
Pass verdict:
The IUT successfully writes to the ASE Control Point characteristic with the
opcode set to 0x02 (Config QoS) and the specified parameters.
Test Summary
------------
BAP/UCL/SCC/BV-099-C [UCL SNK Config QoS, VS] Passed
BAP/UCL/SCC/BV-100-C [UCL SRC Config QoS, VS] Passed
Total: 2, Passed: 2 (100.0%), Failed: 0, Not Run: 0
---
unit/test-bap.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index 303388e35c14..fdfedde6b965 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -2146,11 +2146,54 @@ static void test_scc_qos_lc3(void)
test_client, &cfg_src_48_6_2, SCC_SRC_48_6_2);
}
+static struct test_config cfg_snk_qos_vs = {
+ .cc = IOV_NULL,
+ .qos = QOS_UCAST,
+ .snk = true,
+ .vs = true,
+ .state = BT_BAP_STREAM_STATE_QOS
+};
+
+#define SCC_SNK_QOS_VS \
+ SCC_SNK_VS, \
+ QOS_SNK(0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00)
+
+static struct test_config cfg_src_qos_vs = {
+ .cc = IOV_NULL,
+ .qos = QOS_UCAST,
+ .src = true,
+ .vs = true,
+ .state = BT_BAP_STREAM_STATE_QOS
+};
+
+#define SCC_SRC_QOS_VS \
+ SCC_SRC_VS, \
+ QOS_SRC(0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00)
+
+/* Test Purpose:
+ * Verify that a Unicast Client IUT can initiate a Config QoS operation for a
+ * vendor-specific codec.
+ *
+ * Pass verdict:
+ * The IUT successfully writes to the ASE Control Point characteristic with the
+ * opcode set to 0x02 (Config QoS) and the specified parameters.
+ */
+static void test_scc_qos_vs(void)
+{
+ define_test("BAP/UCL/SCC/BV-099-C [UCL SNK Config QoS, VS]",
+ test_client, &cfg_src_qos_vs, SCC_SRC_QOS_VS);
+ define_test("BAP/UCL/SCC/BV-100-C [UCL SRC QoS Codec, VS]",
+ test_client, &cfg_snk_qos_vs, SCC_SNK_QOS_VS);
+}
+
static void test_scc(void)
{
test_scc_cc_lc3();
test_scc_cc_vs();
test_scc_qos_lc3();
+ test_scc_qos_vs();
}
int main(int argc, char *argv[])
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
4.8.5 Unicast Client Initiates Enable Operation (Page 48)
Test Purpose:
Verify that a Unicast Client IUT can initiate an Enable operation for an ASE
with a Unicast Server that is either in the Audio Sink role or the Audio
Source role.
Pass verdict:
The IUT successfully writes to the ASE Control Point characteristic with the
opcode set to 0x03 (Enable) and the specified parameters.
Test Summary
------------
BAP/UCL/SCC/BV-101-C [UCL SRC Enable] Passed
BAP/UCL/SCC/BV-102-C [UCL SNK Enable] Passed
Total: 2, Passed: 2 (100.0%), Failed: 0, Not Run: 0
---
unit/test-bap.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 91 insertions(+), 1 deletion(-)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index fdfedde6b965..9369983ba97d 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -335,7 +335,7 @@ static void test_complete_cb(const void *user_data)
tester_test_passed();
}
-static void bap_qos(struct bt_bap_stream *stream,
+static void bap_enable(struct bt_bap_stream *stream,
uint8_t code, uint8_t reason,
void *user_data)
{
@@ -343,6 +343,26 @@ static void bap_qos(struct bt_bap_stream *stream,
tester_test_failed();
}
+static void bap_qos(struct bt_bap_stream *stream,
+ uint8_t code, uint8_t reason,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+
+ if (code) {
+ tester_test_failed();
+ return;
+ }
+
+ if (data->cfg->state > BT_BAP_STREAM_STATE_QOS) {
+ unsigned int qos_id;
+
+ qos_id = bt_bap_stream_enable(data->stream, true, NULL,
+ bap_enable, data);
+ g_assert(qos_id);
+ }
+}
+
static void bap_config(struct bt_bap_stream *stream,
uint8_t code, uint8_t reason,
void *user_data)
@@ -2188,12 +2208,82 @@ static void test_scc_qos_vs(void)
test_client, &cfg_snk_qos_vs, SCC_SNK_QOS_VS);
}
+static struct test_config cfg_snk_enable = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_ENABLING
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 03010104030201
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0301010000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x0016
+ * Data: 0101010300403020100
+ */
+#define SCC_SNK_ENABLE \
+ SCC_SNK_16_2_1, \
+ IOV_DATA(0x52, 0x22, 0x00, 0x03, 0x01, 0x01, 0x04, 0x03, 0x02, 0x01, \
+ 00), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x03, 0x00, 0x00, 0x04, 0x03, 0x02, \
+ 0x01, 0x00)
+
+static struct test_config cfg_src_enable = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_ENABLING
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 0301030403020100
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0301030000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x001c
+ * Data: 030300000403020100
+ */
+#define SCC_SRC_ENABLE \
+ SCC_SRC_16_2_1, \
+ IOV_DATA(0x52, 0x22, 0x00, 0x03, 0x01, 0x03, 0x04, 0x03, 0x02, 0x01, \
+ 00), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x03, 0x00, 0x00, 0x04, 0x03, 0x02, \
+ 0x01, 0x00)
+
+/* Test Purpose:
+ * Verify that a Unicast Client IUT can initiate an Enable operation for an ASE
+ * with a Unicast Server that is either in the Audio Sink role or the Audio
+ * Source role.
+ *
+ * Pass verdict:
+ * The IUT successfully writes to the ASE Control Point characteristic with the
+ * opcode set to 0x03 (Enable) and the specified parameters.
+ */
+static void test_scc_enable(void)
+{
+ define_test("BAP/UCL/SCC/BV-101-C [UCL SRC Enable]",
+ test_client, &cfg_snk_enable, SCC_SNK_ENABLE);
+ define_test("BAP/UCL/SCC/BV-102-C [UCL SNK Enable]",
+ test_client, &cfg_src_enable, SCC_SRC_ENABLE);
+}
+
static void test_scc(void)
{
test_scc_cc_lc3();
test_scc_cc_vs();
test_scc_qos_lc3();
test_scc_qos_vs();
+ test_scc_enable();
}
int main(int argc, char *argv[])
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
4.8.3 Unicast Client Initiates Config QoS – LC3
(Page 43)
Test Purpose:
Verify that a Unicast Client IUT can initiate a Config QoS operation for the
LC3 codec.
Pass verdict:
The IUT successfully writes to the ASE Control Point characteristic with the
opcode set to 0x02 (Config QoS) and the specified parameters.
Test Summary
------------
BAP/UCL/SCC/BV-035-C [UCL SRC Config QoS, LC3 8_1_1] Passed
BAP/UCL/SCC/BV-036-C [UCL SRC Config QoS, LC3 8_2_1] Passed
BAP/UCL/SCC/BV-037-C [UCL SRC Config QoS, LC3 16_1_1] Passed
BAP/UCL/SCC/BV-038-C [UCL SRC Config QoS, LC3 16_2_1] Passed
BAP/UCL/SCC/BV-039-C [UCL SRC Config QoS, LC3 24_1_1] Passed
BAP/UCL/SCC/BV-040-C [UCL SRC Config QoS, LC3 24_2_1] Passed
BAP/UCL/SCC/BV-041-C [UCL SRC Config QoS, LC3 32_1_1] Passed
BAP/UCL/SCC/BV-042-C [UCL SRC Config QoS, LC3 32_2_1] Passed
BAP/UCL/SCC/BV-043-C [UCL SRC Config QoS, LC3 44.1_1_1] Passed
BAP/UCL/SCC/BV-044-C [UCL SRC Config QoS, LC3 44.1_2_1] Passed
BAP/UCL/SCC/BV-045-C [UCL SRC Config QoS, LC3 48_1_1] Passed
BAP/UCL/SCC/BV-046-C [UCL SRC Config QoS, LC3 48_2_1] Passed
BAP/UCL/SCC/BV-047-C [UCL SRC Config QoS, LC3 48_3_1] Passed
BAP/UCL/SCC/BV-048-C [UCL SRC Config QoS, LC3 48_4_1] Passed
BAP/UCL/SCC/BV-049-C [UCL SRC Config QoS, LC3 48_5_1] Passed
BAP/UCL/SCC/BV-050-C [UCL SRC Config QoS, LC3 48_6_1] Passed
BAP/UCL/SCC/BV-051-C [UCL SNK Config QoS, LC3 8_1_1] Passed
BAP/UCL/SCC/BV-052-C [UCL SNK Config QoS, LC3 8_2_1] Passed
BAP/UCL/SCC/BV-053-C [UCL SNK Config QoS, LC3 16_1_1] Passed
BAP/UCL/SCC/BV-054-C [UCL SNK Config QoS, LC3 16_2_1] Passed
BAP/UCL/SCC/BV-055-C [UCL SNK Config QoS, LC3 24_1_1] Passed
BAP/UCL/SCC/BV-056-C [UCL SNK Config QoS, LC3 24_2_1] Passed
BAP/UCL/SCC/BV-057-C [UCL SNK Config QoS, LC3 32_1_1] Passed
BAP/UCL/SCC/BV-058-C [UCL SNK Config QoS, LC3 32_2_1] Passed
BAP/UCL/SCC/BV-059-C [UCL SNK Config QoS, LC3 44.1_1_1] Passed
BAP/UCL/SCC/BV-060-C [UCL SNK Config QoS, LC3 44.1_2_1] Passed
BAP/UCL/SCC/BV-061-C [UCL SNK Config QoS, LC3 48_1_1] Passed
BAP/UCL/SCC/BV-062-C [UCL SNK Config QoS, LC3 48_2_1] Passed
BAP/UCL/SCC/BV-063-C [UCL SNK Config QoS, LC3 48_3_1] Passed
BAP/UCL/SCC/BV-064-C [UCL SNK Config QoS, LC3 48_4_1] Passed
BAP/UCL/SCC/BV-065-C [UCL SNK Config QoS, LC3 48_5_1] Passed
BAP/UCL/SCC/BV-066-C [UCL SNK Config QoS, LC3 48_6_1] Passed
BAP/UCL/SCC/BV-067-C [UCL SRC Config QoS, LC3 8_1_2] Passed
BAP/UCL/SCC/BV-068-C [UCL SRC Config QoS, LC3 8_2_2] Passed
BAP/UCL/SCC/BV-069-C [UCL SRC Config QoS, LC3 16_1_2] Passed
BAP/UCL/SCC/BV-070-C [UCL SRC Config QoS, LC3 16_2_2] Passed
BAP/UCL/SCC/BV-071-C [UCL SRC Config QoS, LC3 24_1_2] Passed
BAP/UCL/SCC/BV-072-C [UCL SRC Config QoS, LC3 24_2_2] Passed
BAP/UCL/SCC/BV-073-C [UCL SRC Config QoS, LC3 32_1_2] Passed
BAP/UCL/SCC/BV-074-C [UCL SRC Config QoS, LC3 32_2_2] Passed
BAP/UCL/SCC/BV-075-C [UCL SRC Config QoS, LC3 44.1_1_2] Passed
BAP/UCL/SCC/BV-076-C [UCL SRC Config QoS, LC3 44.1_2_2] Passed
BAP/UCL/SCC/BV-077-C [UCL SRC Config QoS, LC3 48_1_2] Passed
BAP/UCL/SCC/BV-078-C [UCL SRC Config QoS, LC3 48_2_2] Passed
BAP/UCL/SCC/BV-079-C [UCL SRC Config QoS, LC3 48_3_2] Passed
BAP/UCL/SCC/BV-080-C [UCL SRC Config QoS, LC3 48_4_2] Passed
BAP/UCL/SCC/BV-081-C [UCL SRC Config QoS, LC3 48_5_2] Passed
BAP/UCL/SCC/BV-082-C [UCL SRC Config QoS, LC3 48_6_2] Passed
BAP/UCL/SCC/BV-083-C [UCL SNK Config QoS, LC3 8_1_2] Passed
BAP/UCL/SCC/BV-084-C [UCL SNK Config QoS, LC3 8_2_2] Passed
BAP/UCL/SCC/BV-085-C [UCL SNK Config QoS, LC3 16_1_2] Passed
BAP/UCL/SCC/BV-086-C [UCL SNK Config QoS, LC3 16_2_2] Passed
BAP/UCL/SCC/BV-087-C [UCL SNK Config QoS, LC3 24_1_2] Passed
BAP/UCL/SCC/BV-088-C [UCL SNK Config QoS, LC3 24_2_2] Passed
BAP/UCL/SCC/BV-089-C [UCL SNK Config QoS, LC3 32_1_2] Passed
BAP/UCL/SCC/BV-090-C [UCL SNK Config QoS, LC3 32_2_2] Passed
BAP/UCL/SCC/BV-091-C [UCL SNK Config QoS, LC3 44.1_1_2] Passed
BAP/UCL/SCC/BV-092-C [UCL SNK Config QoS, LC3 44.1_2_2] Passed
BAP/UCL/SCC/BV-093-C [UCL SNK Config QoS, LC3 48_1_2] Passed
BAP/UCL/SCC/BV-094-C [UCL SNK Config QoS, LC3 48_2_2] Passed
BAP/UCL/SCC/BV-095-C [UCL SNK Config QoS, LC3 48_3_2] Passed
BAP/UCL/SCC/BV-096-C [UCL SNK Config QoS, LC3 48_4_2] Passed
BAP/UCL/SCC/BV-097-C [UCL SNK Config QoS, LC3 48_5_2] Passed
BAP/UCL/SCC/BV-098-C [UCL SNK Config QoS, LC3 48_6_2] Passed
Total: 64, Passed: 64 (100.0%), Failed: 0, Not Run: 0
---
unit/test-bap.c | 964 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 963 insertions(+), 1 deletion(-)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index adade07dbe9e..303388e35c14 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -39,6 +39,7 @@ struct test_config {
bool snk;
bool src;
bool vs;
+ uint8_t state;
};
struct test_data {
@@ -334,7 +335,7 @@ static void test_complete_cb(const void *user_data)
tester_test_passed();
}
-static void bap_config(struct bt_bap_stream *stream,
+static void bap_qos(struct bt_bap_stream *stream,
uint8_t code, uint8_t reason,
void *user_data)
{
@@ -342,6 +343,26 @@ static void bap_config(struct bt_bap_stream *stream,
tester_test_failed();
}
+static void bap_config(struct bt_bap_stream *stream,
+ uint8_t code, uint8_t reason,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+
+ if (code) {
+ tester_test_failed();
+ return;
+ }
+
+ if (data->cfg->state > BT_BAP_STREAM_STATE_CONFIG) {
+ unsigned int qos_id;
+
+ qos_id = bt_bap_stream_qos(data->stream, &data->cfg->qos,
+ bap_qos, data);
+ g_assert(qos_id);
+ }
+}
+
static bool pac_found(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
void *user_data)
{
@@ -1185,10 +1206,951 @@ static void test_scc_cc_vs(void)
test_client, &cfg_src_vs, SCC_SRC_VS);
}
+static struct test_config cfg_snk_8_1_1 = {
+ .cc = LC3_CONFIG_8_1,
+ .qos = LC3_QOS_8_1_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_8_2_1 = {
+ .cc = LC3_CONFIG_8_2,
+ .qos = LC3_QOS_8_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_16_1_1 = {
+ .cc = LC3_CONFIG_16_1,
+ .qos = LC3_QOS_16_1_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_16_2_1 = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_24_1_1 = {
+ .cc = LC3_CONFIG_24_1,
+ .qos = LC3_QOS_24_1_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_24_2_1 = {
+ .cc = LC3_CONFIG_24_2,
+ .qos = LC3_QOS_24_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_32_1_1 = {
+ .cc = LC3_CONFIG_32_1,
+ .qos = LC3_QOS_32_1_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_32_2_1 = {
+ .cc = LC3_CONFIG_32_2,
+ .qos = LC3_QOS_32_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_44_1_1 = {
+ .cc = LC3_CONFIG_44_1,
+ .qos = LC3_QOS_44_1_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_44_2_1 = {
+ .cc = LC3_CONFIG_44_2,
+ .qos = LC3_QOS_44_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_1_1 = {
+ .cc = LC3_CONFIG_48_1,
+ .qos = LC3_QOS_48_1_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_2_1 = {
+ .cc = LC3_CONFIG_48_2,
+ .qos = LC3_QOS_48_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_3_1 = {
+ .cc = LC3_CONFIG_48_3,
+ .qos = LC3_QOS_48_3_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_4_1 = {
+ .cc = LC3_CONFIG_48_4,
+ .qos = LC3_QOS_48_4_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_5_1 = {
+ .cc = LC3_CONFIG_48_5,
+ .qos = LC3_QOS_48_5_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_6_1 = {
+ .cc = LC3_CONFIG_48_6,
+ .qos = LC3_QOS_48_6_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 02010000_qos
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0201010000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x0016
+ * Data: 01010102010a00204e00409c00204e00409c00_qos
+ */
+#define QOS_SNK(_qos...) \
+ IOV_DATA(0x52, 0x22, 0x00, 0x02, 0x01, 0x01, 0x00, 0x00, _qos), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x02, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x02, 0x00, 0x00, _qos)
+
+#define SCC_SNK_8_1_1 \
+ SCC_SNK_8_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_8_2_1 \
+ SCC_SNK_8_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_16_1_1 \
+ SCC_SNK_16_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_16_2_1 \
+ SCC_SNK_16_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x28, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_24_1_1 \
+ SCC_SNK_24_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x2d, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_24_2_1 \
+ SCC_SNK_24_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_32_1_1 \
+ SCC_SNK_32_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_32_2_1 \
+ SCC_SNK_32_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x50, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_44_1_1 \
+ SCC_SNK_44_1, \
+ QOS_SNK(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x05, 0x18, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_44_2_1 \
+ SCC_SNK_44_2, \
+ QOS_SNK(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x05, 0x1f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_1_1 \
+ SCC_SNK_48_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x05, 0x0f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_2_1 \
+ SCC_SNK_48_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x64, 0x00, 0x05, 0x14, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_3_1 \
+ SCC_SNK_48_3, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x05, 0x0f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_4_1 \
+ SCC_SNK_48_4, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x78, 0x00, 0x05, 0x14, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_5_1 \
+ SCC_SNK_48_5, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x75, 0x00, 0x05, 0x0f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_6_1 \
+ SCC_SNK_48_6, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x05, 0x14, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+static struct test_config cfg_src_8_1_1 = {
+ .cc = LC3_CONFIG_8_1,
+ .qos = LC3_QOS_8_1_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_8_2_1 = {
+ .cc = LC3_CONFIG_8_2,
+ .qos = LC3_QOS_8_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_16_1_1 = {
+ .cc = LC3_CONFIG_16_1,
+ .qos = LC3_QOS_16_1_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_16_2_1 = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_24_1_1 = {
+ .cc = LC3_CONFIG_24_1,
+ .qos = LC3_QOS_24_1_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_24_2_1 = {
+ .cc = LC3_CONFIG_24_2,
+ .qos = LC3_QOS_24_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_32_1_1 = {
+ .cc = LC3_CONFIG_32_1,
+ .qos = LC3_QOS_32_1_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_32_2_1 = {
+ .cc = LC3_CONFIG_32_2,
+ .qos = LC3_QOS_32_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_44_1_1 = {
+ .cc = LC3_CONFIG_44_1,
+ .qos = LC3_QOS_44_1_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_44_2_1 = {
+ .cc = LC3_CONFIG_44_2,
+ .qos = LC3_QOS_44_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_1_1 = {
+ .cc = LC3_CONFIG_48_1,
+ .qos = LC3_QOS_48_1_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_2_1 = {
+ .cc = LC3_CONFIG_48_2,
+ .qos = LC3_QOS_48_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_3_1 = {
+ .cc = LC3_CONFIG_48_3,
+ .qos = LC3_QOS_48_3_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_4_1 = {
+ .cc = LC3_CONFIG_48_4,
+ .qos = LC3_QOS_48_4_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_5_1 = {
+ .cc = LC3_CONFIG_48_5,
+ .qos = LC3_QOS_48_5_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_6_1 = {
+ .cc = LC3_CONFIG_48_6,
+ .qos = LC3_QOS_48_6_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 02030000_qos
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0201030000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x001c
+ * Data: 03010102010a00204e00409c00204e00409c00_qos
+ */
+#define QOS_SRC(_qos...) \
+ IOV_DATA(0x52, 0x22, 0x00, 0x02, 0x01, 0x03, 0x00, 0x00, _qos), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x02, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x02, 0x00, 0x00, _qos)
+
+#define SCC_SRC_8_1_1 \
+ SCC_SRC_8_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_8_2_1 \
+ SCC_SRC_8_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_16_1_1 \
+ SCC_SRC_16_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_16_2_1 \
+ SCC_SRC_16_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x28, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_24_1_1 \
+ SCC_SRC_24_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x2d, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_24_2_1 \
+ SCC_SRC_24_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_32_1_1 \
+ SCC_SRC_32_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x02, 0x08, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_32_2_1 \
+ SCC_SRC_32_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x50, 0x00, 0x02, 0x0a, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_44_1_1 \
+ SCC_SRC_44_1, \
+ QOS_SRC(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x05, 0x18, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_44_2_1 \
+ SCC_SRC_44_2, \
+ QOS_SRC(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x05, 0x1f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_1_1 \
+ SCC_SRC_48_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x05, 0x0f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_2_1 \
+ SCC_SRC_48_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x64, 0x00, 0x05, 0x14, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_3_1 \
+ SCC_SRC_48_3, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x05, 0x0f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_4_1 \
+ SCC_SRC_48_4, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x78, 0x00, 0x05, 0x14, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_5_1 \
+ SCC_SRC_48_5, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x75, 0x00, 0x05, 0x0f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_6_1 \
+ SCC_SRC_48_6, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x05, 0x14, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+static struct test_config cfg_snk_8_1_2 = {
+ .cc = LC3_CONFIG_8_1,
+ .qos = LC3_QOS_8_1_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_8_2_2 = {
+ .cc = LC3_CONFIG_8_2,
+ .qos = LC3_QOS_8_2_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_16_1_2 = {
+ .cc = LC3_CONFIG_16_1,
+ .qos = LC3_QOS_16_1_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_16_2_2 = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_24_1_2 = {
+ .cc = LC3_CONFIG_24_1,
+ .qos = LC3_QOS_24_1_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_24_2_2 = {
+ .cc = LC3_CONFIG_24_2,
+ .qos = LC3_QOS_24_2_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_32_1_2 = {
+ .cc = LC3_CONFIG_32_1,
+ .qos = LC3_QOS_32_1_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_32_2_2 = {
+ .cc = LC3_CONFIG_32_2,
+ .qos = LC3_QOS_32_2_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_44_1_2 = {
+ .cc = LC3_CONFIG_44_1,
+ .qos = LC3_QOS_44_1_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_44_2_2 = {
+ .cc = LC3_CONFIG_44_2,
+ .qos = LC3_QOS_44_2_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_1_2 = {
+ .cc = LC3_CONFIG_48_1,
+ .qos = LC3_QOS_48_1_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_2_2 = {
+ .cc = LC3_CONFIG_48_2,
+ .qos = LC3_QOS_48_2_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_3_2 = {
+ .cc = LC3_CONFIG_48_3,
+ .qos = LC3_QOS_48_3_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_4_2 = {
+ .cc = LC3_CONFIG_48_4,
+ .qos = LC3_QOS_48_4_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_5_2 = {
+ .cc = LC3_CONFIG_48_5,
+ .qos = LC3_QOS_48_5_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_snk_48_6_2 = {
+ .cc = LC3_CONFIG_48_6,
+ .qos = LC3_QOS_48_6_2,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+#define SCC_SNK_8_1_2 \
+ SCC_SNK_8_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_8_2_2 \
+ SCC_SNK_8_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_16_1_2 \
+ SCC_SNK_16_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_16_2_2 \
+ SCC_SNK_16_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x28, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_24_1_2 \
+ SCC_SNK_24_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x2d, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_24_2_2 \
+ SCC_SNK_24_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_32_1_2 \
+ SCC_SNK_32_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_32_2_2 \
+ SCC_SNK_32_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x50, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_44_1_2 \
+ SCC_SNK_44_1, \
+ QOS_SNK(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x0d, 0x50, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_44_2_2 \
+ SCC_SNK_44_2, \
+ QOS_SNK(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x0d, 0x55, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_1_2 \
+ SCC_SNK_48_1, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_2_2 \
+ SCC_SNK_48_2, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x64, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_3_2 \
+ SCC_SNK_48_3, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_4_2 \
+ SCC_SNK_48_4, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x78, 0x00, 0x0d, 0x64, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_5_2 \
+ SCC_SNK_48_5, \
+ QOS_SNK(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x75, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SNK_48_6_2 \
+ SCC_SNK_48_6, \
+ QOS_SNK(0x10, 0x27, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x0d, 0x64, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+static struct test_config cfg_src_8_1_2 = {
+ .cc = LC3_CONFIG_8_1,
+ .qos = LC3_QOS_8_1_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_8_2_2 = {
+ .cc = LC3_CONFIG_8_2,
+ .qos = LC3_QOS_8_2_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_16_1_2 = {
+ .cc = LC3_CONFIG_16_1,
+ .qos = LC3_QOS_16_1_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_16_2_2 = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_24_1_2 = {
+ .cc = LC3_CONFIG_24_1,
+ .qos = LC3_QOS_24_1_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_24_2_2 = {
+ .cc = LC3_CONFIG_24_2,
+ .qos = LC3_QOS_24_2_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_32_1_2 = {
+ .cc = LC3_CONFIG_32_1,
+ .qos = LC3_QOS_32_1_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_32_2_2 = {
+ .cc = LC3_CONFIG_32_2,
+ .qos = LC3_QOS_32_2_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_44_1_2 = {
+ .cc = LC3_CONFIG_44_1,
+ .qos = LC3_QOS_44_1_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_44_2_2 = {
+ .cc = LC3_CONFIG_44_2,
+ .qos = LC3_QOS_44_2_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_1_2 = {
+ .cc = LC3_CONFIG_48_1,
+ .qos = LC3_QOS_48_1_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_2_2 = {
+ .cc = LC3_CONFIG_48_2,
+ .qos = LC3_QOS_48_2_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_3_2 = {
+ .cc = LC3_CONFIG_48_3,
+ .qos = LC3_QOS_48_3_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_4_2 = {
+ .cc = LC3_CONFIG_48_4,
+ .qos = LC3_QOS_48_4_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_5_2 = {
+ .cc = LC3_CONFIG_48_5,
+ .qos = LC3_QOS_48_5_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+static struct test_config cfg_src_48_6_2 = {
+ .cc = LC3_CONFIG_48_6,
+ .qos = LC3_QOS_48_6_2,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+};
+
+#define SCC_SRC_8_1_2 \
+ SCC_SRC_8_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_8_2_2 \
+ SCC_SRC_8_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_16_1_2 \
+ SCC_SRC_16_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x1e, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_16_2_2 \
+ SCC_SRC_16_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x28, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_24_1_2 \
+ SCC_SRC_24_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x2d, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_24_2_2 \
+ SCC_SRC_24_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_32_1_2 \
+ SCC_SRC_32_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_32_2_2 \
+ SCC_SRC_32_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x50, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_44_1_2 \
+ SCC_SRC_44_1, \
+ QOS_SRC(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x0d, 0x50, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_44_2_2 \
+ SCC_SRC_44_2, \
+ QOS_SRC(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x0d, 0x55, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_1_2 \
+ SCC_SRC_48_1, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_2_2 \
+ SCC_SRC_48_2, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x64, 0x00, 0x0d, 0x5f, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_3_2 \
+ SCC_SRC_48_3, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_4_2 \
+ SCC_SRC_48_4, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x78, 0x00, 0x0d, 0x64, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_5_2 \
+ SCC_SRC_48_5, \
+ QOS_SRC(0x4c, 0x1d, 0x00, 0x00, 0x02, 0x75, 0x00, 0x0d, 0x4b, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+#define SCC_SRC_48_6_2 \
+ SCC_SRC_48_6, \
+ QOS_SRC(0x10, 0x27, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x0d, 0x64, 0x00, \
+ 0x40, 0x9c, 0x00)
+
+/* Test Purpose:
+ * Verify that a Unicast Client IUT can initiate a Config QoS operation for the
+ * LC3 codec.
+ *
+ * Pass verdict:
+ * The IUT successfully writes to the ASE Control Point characteristic with the
+ * opcode set to 0x02 (Config QoS) and the specified parameters.
+ */
+static void test_scc_qos_lc3(void)
+{
+ define_test("BAP/UCL/SCC/BV-035-C [UCL SRC Config QoS, LC3 8_1_1]",
+ test_client, &cfg_snk_8_1_1, SCC_SNK_8_1_1);
+ define_test("BAP/UCL/SCC/BV-036-C [UCL SRC Config QoS, LC3 8_2_1]",
+ test_client, &cfg_snk_8_2_1, SCC_SNK_8_2_1);
+ define_test("BAP/UCL/SCC/BV-037-C [UCL SRC Config QoS, LC3 16_1_1]",
+ test_client, &cfg_snk_16_1_1, SCC_SNK_16_1_1);
+ define_test("BAP/UCL/SCC/BV-038-C [UCL SRC Config QoS, LC3 16_2_1]",
+ test_client, &cfg_snk_16_2_1, SCC_SNK_16_2_1);
+ define_test("BAP/UCL/SCC/BV-039-C [UCL SRC Config QoS, LC3 24_1_1]",
+ test_client, &cfg_snk_24_1_1, SCC_SNK_24_1_1);
+ define_test("BAP/UCL/SCC/BV-040-C [UCL SRC Config QoS, LC3 24_2_1]",
+ test_client, &cfg_snk_24_2_1, SCC_SNK_24_2_1);
+ define_test("BAP/UCL/SCC/BV-041-C [UCL SRC Config QoS, LC3 32_1_1]",
+ test_client, &cfg_snk_32_1_1, SCC_SNK_32_1_1);
+ define_test("BAP/UCL/SCC/BV-042-C [UCL SRC Config QoS, LC3 32_2_1]",
+ test_client, &cfg_snk_32_2_1, SCC_SNK_32_2_1);
+ define_test("BAP/UCL/SCC/BV-043-C [UCL SRC Config QoS, LC3 44.1_1_1]",
+ test_client, &cfg_snk_44_1_1, SCC_SNK_44_1_1);
+ define_test("BAP/UCL/SCC/BV-044-C [UCL SRC Config QoS, LC3 44.1_2_1]",
+ test_client, &cfg_snk_44_2_1, SCC_SNK_44_2_1);
+ define_test("BAP/UCL/SCC/BV-045-C [UCL SRC Config QoS, LC3 48_1_1]",
+ test_client, &cfg_snk_48_1_1, SCC_SNK_48_1_1);
+ define_test("BAP/UCL/SCC/BV-046-C [UCL SRC Config QoS, LC3 48_2_1]",
+ test_client, &cfg_snk_48_2_1, SCC_SNK_48_2_1);
+ define_test("BAP/UCL/SCC/BV-047-C [UCL SRC Config QoS, LC3 48_3_1]",
+ test_client, &cfg_snk_48_3_1, SCC_SNK_48_3_1);
+ define_test("BAP/UCL/SCC/BV-048-C [UCL SRC Config QoS, LC3 48_4_1]",
+ test_client, &cfg_snk_48_4_1, SCC_SNK_48_4_1);
+ define_test("BAP/UCL/SCC/BV-049-C [UCL SRC Config QoS, LC3 48_5_1]",
+ test_client, &cfg_snk_48_5_1, SCC_SNK_48_5_1);
+ define_test("BAP/UCL/SCC/BV-050-C [UCL SRC Config QoS, LC3 48_6_1]",
+ test_client, &cfg_snk_48_6_1, SCC_SNK_48_6_1);
+ define_test("BAP/UCL/SCC/BV-051-C [UCL SNK Config QoS, LC3 8_1_1]",
+ test_client, &cfg_src_8_1_1, SCC_SRC_8_1_1);
+ define_test("BAP/UCL/SCC/BV-052-C [UCL SNK Config QoS, LC3 8_2_1]",
+ test_client, &cfg_src_8_2_1, SCC_SRC_8_2_1);
+ define_test("BAP/UCL/SCC/BV-053-C [UCL SNK Config QoS, LC3 16_1_1]",
+ test_client, &cfg_src_16_1_1, SCC_SRC_16_1_1);
+ define_test("BAP/UCL/SCC/BV-054-C [UCL SNK Config QoS, LC3 16_2_1]",
+ test_client, &cfg_src_16_2_1, SCC_SRC_16_2_1);
+ define_test("BAP/UCL/SCC/BV-055-C [UCL SNK Config QoS, LC3 24_1_1]",
+ test_client, &cfg_src_24_1_1, SCC_SRC_24_1_1);
+ define_test("BAP/UCL/SCC/BV-056-C [UCL SNK Config QoS, LC3 24_2_1]",
+ test_client, &cfg_src_24_2_1, SCC_SRC_24_2_1);
+ define_test("BAP/UCL/SCC/BV-057-C [UCL SNK Config QoS, LC3 32_1_1]",
+ test_client, &cfg_src_32_1_1, SCC_SRC_32_1_1);
+ define_test("BAP/UCL/SCC/BV-058-C [UCL SNK Config QoS, LC3 32_2_1]",
+ test_client, &cfg_src_32_2_1, SCC_SRC_32_2_1);
+ define_test("BAP/UCL/SCC/BV-059-C [UCL SNK Config QoS, LC3 44.1_1_1]",
+ test_client, &cfg_src_44_1_1, SCC_SRC_44_1_1);
+ define_test("BAP/UCL/SCC/BV-060-C [UCL SNK Config QoS, LC3 44.1_2_1]",
+ test_client, &cfg_src_44_2_1, SCC_SRC_44_2_1);
+ define_test("BAP/UCL/SCC/BV-061-C [UCL SNK Config QoS, LC3 48_1_1]",
+ test_client, &cfg_src_48_1_1, SCC_SRC_48_1_1);
+ define_test("BAP/UCL/SCC/BV-062-C [UCL SNK Config QoS, LC3 48_2_1]",
+ test_client, &cfg_src_48_2_1, SCC_SRC_48_2_1);
+ define_test("BAP/UCL/SCC/BV-063-C [UCL SNK Config QoS, LC3 48_3_1]",
+ test_client, &cfg_src_48_3_1, SCC_SRC_48_3_1);
+ define_test("BAP/UCL/SCC/BV-064-C [UCL SNK Config QoS, LC3 48_4_1]",
+ test_client, &cfg_src_48_4_1, SCC_SRC_48_4_1);
+ define_test("BAP/UCL/SCC/BV-065-C [UCL SNK Config QoS, LC3 48_5_1]",
+ test_client, &cfg_src_48_5_1, SCC_SRC_48_5_1);
+ define_test("BAP/UCL/SCC/BV-066-C [UCL SNK Config QoS, LC3 48_6_1]",
+ test_client, &cfg_src_48_6_1, SCC_SRC_48_6_1);
+ define_test("BAP/UCL/SCC/BV-067-C [UCL SRC Config QoS, LC3 8_1_2]",
+ test_client, &cfg_snk_8_1_2, SCC_SNK_8_1_2);
+ define_test("BAP/UCL/SCC/BV-068-C [UCL SRC Config QoS, LC3 8_2_2]",
+ test_client, &cfg_snk_8_2_2, SCC_SNK_8_2_2);
+ define_test("BAP/UCL/SCC/BV-069-C [UCL SRC Config QoS, LC3 16_1_2]",
+ test_client, &cfg_snk_16_1_2, SCC_SNK_16_1_2);
+ define_test("BAP/UCL/SCC/BV-070-C [UCL SRC Config QoS, LC3 16_2_2]",
+ test_client, &cfg_snk_16_2_2, SCC_SNK_16_2_2);
+ define_test("BAP/UCL/SCC/BV-071-C [UCL SRC Config QoS, LC3 24_1_2]",
+ test_client, &cfg_snk_24_1_2, SCC_SNK_24_1_2);
+ define_test("BAP/UCL/SCC/BV-072-C [UCL SRC Config QoS, LC3 24_2_2]",
+ test_client, &cfg_snk_24_2_2, SCC_SNK_24_2_2);
+ define_test("BAP/UCL/SCC/BV-073-C [UCL SRC Config QoS, LC3 32_1_2]",
+ test_client, &cfg_snk_32_1_2, SCC_SNK_32_1_2);
+ define_test("BAP/UCL/SCC/BV-074-C [UCL SRC Config QoS, LC3 32_2_2]",
+ test_client, &cfg_snk_32_2_2, SCC_SNK_32_2_2);
+ define_test("BAP/UCL/SCC/BV-075-C [UCL SRC Config QoS, LC3 44.1_1_2]",
+ test_client, &cfg_snk_44_1_2, SCC_SNK_44_1_2);
+ define_test("BAP/UCL/SCC/BV-076-C [UCL SRC Config QoS, LC3 44.1_2_2]",
+ test_client, &cfg_snk_44_2_2, SCC_SNK_44_2_2);
+ define_test("BAP/UCL/SCC/BV-077-C [UCL SRC Config QoS, LC3 48_1_2]",
+ test_client, &cfg_snk_48_1_2, SCC_SNK_48_1_2);
+ define_test("BAP/UCL/SCC/BV-078-C [UCL SRC Config QoS, LC3 48_2_2]",
+ test_client, &cfg_snk_48_2_2, SCC_SNK_48_2_2);
+ define_test("BAP/UCL/SCC/BV-079-C [UCL SRC Config QoS, LC3 48_3_2]",
+ test_client, &cfg_snk_48_3_2, SCC_SNK_48_3_2);
+ define_test("BAP/UCL/SCC/BV-080-C [UCL SRC Config QoS, LC3 48_4_2]",
+ test_client, &cfg_snk_48_4_2, SCC_SNK_48_4_2);
+ define_test("BAP/UCL/SCC/BV-081-C [UCL SRC Config QoS, LC3 48_5_2]",
+ test_client, &cfg_snk_48_5_2, SCC_SNK_48_5_2);
+ define_test("BAP/UCL/SCC/BV-082-C [UCL SRC Config QoS, LC3 48_6_2]",
+ test_client, &cfg_snk_48_6_2, SCC_SNK_48_6_2);
+ define_test("BAP/UCL/SCC/BV-083-C [UCL SNK Config QoS, LC3 8_1_2]",
+ test_client, &cfg_src_8_1_2, SCC_SRC_8_1_2);
+ define_test("BAP/UCL/SCC/BV-084-C [UCL SNK Config QoS, LC3 8_2_2]",
+ test_client, &cfg_src_8_2_2, SCC_SRC_8_2_2);
+ define_test("BAP/UCL/SCC/BV-085-C [UCL SNK Config QoS, LC3 16_1_2]",
+ test_client, &cfg_src_16_1_2, SCC_SRC_16_1_2);
+ define_test("BAP/UCL/SCC/BV-086-C [UCL SNK Config QoS, LC3 16_2_2]",
+ test_client, &cfg_src_16_2_2, SCC_SRC_16_2_2);
+ define_test("BAP/UCL/SCC/BV-087-C [UCL SNK Config QoS, LC3 24_1_2]",
+ test_client, &cfg_src_24_1_2, SCC_SRC_24_1_2);
+ define_test("BAP/UCL/SCC/BV-088-C [UCL SNK Config QoS, LC3 24_2_2]",
+ test_client, &cfg_src_24_2_2, SCC_SRC_24_2_2);
+ define_test("BAP/UCL/SCC/BV-089-C [UCL SNK Config QoS, LC3 32_1_2]",
+ test_client, &cfg_src_32_1_2, SCC_SRC_32_1_2);
+ define_test("BAP/UCL/SCC/BV-090-C [UCL SNK Config QoS, LC3 32_2_2]",
+ test_client, &cfg_src_32_2_2, SCC_SRC_32_2_2);
+ define_test("BAP/UCL/SCC/BV-091-C [UCL SNK Config QoS, LC3 44.1_1_2]",
+ test_client, &cfg_src_44_1_2, SCC_SRC_44_1_2);
+ define_test("BAP/UCL/SCC/BV-092-C [UCL SNK Config QoS, LC3 44.1_2_2]",
+ test_client, &cfg_src_44_2_2, SCC_SRC_44_2_2);
+ define_test("BAP/UCL/SCC/BV-093-C [UCL SNK Config QoS, LC3 48_1_2]",
+ test_client, &cfg_src_48_1_2, SCC_SRC_48_1_2);
+ define_test("BAP/UCL/SCC/BV-094-C [UCL SNK Config QoS, LC3 48_2_2]",
+ test_client, &cfg_src_48_2_2, SCC_SRC_48_2_2);
+ define_test("BAP/UCL/SCC/BV-095-C [UCL SNK Config QoS, LC3 48_3_2]",
+ test_client, &cfg_src_48_3_2, SCC_SRC_48_3_2);
+ define_test("BAP/UCL/SCC/BV-096-C [UCL SNK Config QoS, LC3 48_4_2]",
+ test_client, &cfg_src_48_4_2, SCC_SRC_48_4_2);
+ define_test("BAP/UCL/SCC/BV-097-C [UCL SNK Config QoS, LC3 48_5_2]",
+ test_client, &cfg_src_48_5_2, SCC_SRC_48_5_2);
+ define_test("BAP/UCL/SCC/BV-098-C [UCL SNK Config QoS, LC3 48_6_2]",
+ test_client, &cfg_src_48_6_2, SCC_SRC_48_6_2);
+}
+
static void test_scc(void)
{
test_scc_cc_lc3();
test_scc_cc_vs();
+ test_scc_qos_lc3();
}
int main(int argc, char *argv[])
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
Requests maybe queued using a stream so when detaching it needs to be
canceled otherwise they can lead crashes like bellow:
Invalid read of size 8
at 0x1C3247: stream_stop_complete (bap.c:1230)
by 0x1BB2A3: bap_req_complete (bap.c:3863)
by 0x1C7BB3: bap_req_detach (bap.c:4219)
by 0x1C7BB3: bt_bap_detach (bap.c:4231)
by 0x1C7BB3: bt_bap_detach (bap.c:4222)
by 0x1C7E67: bap_free (bap.c:2937)
by 0x1C7E67: bt_bap_unref (bap.c:3090)
by 0x1C7E67: bt_bap_unref (bap.c:3082)
by 0x18CCC2: test_teardown (test-bap.c:513)
by 0x1D826A: teardown_callback (tester.c:434)
by 0x491E4FC: g_idle_dispatch (gmain.c:6163)
by 0x49224FB: UnknownInlinedFun (gmain.c:3460)
by 0x49224FB: g_main_context_dispatch (gmain.c:4200)
by 0x49806B7: g_main_context_iterate.isra.0 (gmain.c:4276)
by 0x4921AFE: g_main_loop_run (gmain.c:4479)
by 0x1E8EF4: mainloop_run (mainloop-glib.c:66)
by 0x1E93F7: mainloop_run_with_signal (mainloop-notify.c:188)
Address 0x57b9ad0 is 0 bytes inside a block of size 120 free'd
at 0x4845B2C: free (vg_replace_malloc.c:985)
by 0x1CBAB7: bap_stream_state_changed (bap.c:1290)
by 0x1D3104: bap_ep_set_status (bap.c:3673)
by 0x1DC746: queue_foreach (queue.c:207)
by 0x1A5320: notify_cb (gatt-client.c:2271)
by 0x19A1EF: handle_notify (att.c:1012)
by 0x19A1EF: can_read_data (att.c:1096)
by 0x1D68CF: watch_callback (io-glib.c:157)
by 0x49224FB: UnknownInlinedFun (gmain.c:3460)
by 0x49224FB: g_main_context_dispatch (gmain.c:4200)
by 0x49806B7: g_main_context_iterate.isra.0 (gmain.c:4276)
by 0x4921AFE: g_main_loop_run (gmain.c:4479)
by 0x1E8EF4: mainloop_run (mainloop-glib.c:66)
by 0x1E93F7: mainloop_run_with_signal (mainloop-notify.c:188)
---
src/shared/bap.c | 91 ++++++++++++++++++++++++++----------------------
1 file changed, 50 insertions(+), 41 deletions(-)
diff --git a/src/shared/bap.c b/src/shared/bap.c
index d8a3adde60ca..a1495ca84bcc 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1232,6 +1232,47 @@ static void stream_stop_complete(struct bt_bap_stream *stream, uint8_t code,
bap_stream_io_detach(stream);
}
+static void bap_req_free(void *data)
+{
+ struct bt_bap_req *req = data;
+ size_t i;
+
+ queue_destroy(req->group, bap_req_free);
+
+ for (i = 0; i < req->len; i++)
+ free(req->iov[i].iov_base);
+
+ free(req->iov);
+ free(req);
+}
+
+static void bap_req_complete(struct bt_bap_req *req,
+ const struct bt_ascs_ase_rsp *rsp)
+{
+ struct queue *group;
+
+ if (!req->func)
+ goto done;
+
+ if (rsp)
+ req->func(req->stream, rsp->code, rsp->reason, req->user_data);
+ else
+ req->func(req->stream, BT_ASCS_RSP_UNSPECIFIED, 0x00,
+ req->user_data);
+
+done:
+ /* Detach from request so it can be freed separately */
+ group = req->group;
+ req->group = NULL;
+
+ queue_foreach(group, (queue_foreach_func_t)bap_req_complete,
+ (void *)rsp);
+
+ queue_destroy(group, NULL);
+
+ bap_req_free(req);
+}
+
static void bap_stream_state_changed(struct bt_bap_stream *stream)
{
struct bt_bap *bap = stream->bap;
@@ -1286,6 +1327,10 @@ static void bap_stream_state_changed(struct bt_bap_stream *stream)
/* Post notification updates */
switch (stream->ep->state) {
case BT_ASCS_ASE_STATE_IDLE:
+ if (bap->req && bap->req->stream == stream) {
+ bap_req_complete(bap->req, NULL);
+ bap->req = NULL;
+ }
bap_stream_detach(stream);
break;
case BT_ASCS_ASE_STATE_QOS:
@@ -2905,20 +2950,6 @@ static void bap_state_free(void *data)
free(state);
}
-static void bap_req_free(void *data)
-{
- struct bt_bap_req *req = data;
- size_t i;
-
- queue_destroy(req->group, bap_req_free);
-
- for (i = 0; i < req->len; i++)
- free(req->iov[i].iov_base);
-
- free(req->iov);
- free(req);
-}
-
static void bap_detached(void *data, void *user_data)
{
struct bt_bap_cb *cb = data;
@@ -3809,6 +3840,11 @@ static bool bap_send(struct bt_bap *bap, struct bt_bap_req *req)
DBG(bap, "req %p len %u", req, iov.iov_len);
+ if (req->stream && !queue_find(bap->streams, NULL, req->stream)) {
+ DBG(bap, "stream %p detached, aborting op 0x%02x", req->op);
+ return false;
+ }
+
if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL, &handle,
NULL, NULL, NULL)) {
DBG(bap, "Unable to find Control Point");
@@ -3843,33 +3879,6 @@ static bool bap_send(struct bt_bap *bap, struct bt_bap_req *req)
return true;
}
-static void bap_req_complete(struct bt_bap_req *req,
- const struct bt_ascs_ase_rsp *rsp)
-{
- struct queue *group;
-
- if (!req->func)
- goto done;
-
- if (rsp)
- req->func(req->stream, rsp->code, rsp->reason, req->user_data);
- else
- req->func(req->stream, BT_ASCS_RSP_UNSPECIFIED, 0x00,
- req->user_data);
-
-done:
- /* Detach from request so it can be freed separately */
- group = req->group;
- req->group = NULL;
-
- queue_foreach(group, (queue_foreach_func_t)bap_req_complete,
- (void *)rsp);
-
- queue_destroy(group, NULL);
-
- bap_req_free(req);
-}
-
static bool bap_process_queue(void *data)
{
struct bt_bap *bap = data;
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
4.8.6 Unicast Client Initiates Disable Operation (Page 50):
Test Purpose:
Verify that a Unicast Client IUT can initiate a Disable operation for an ASE
in the Enabling or Streaming state.
Pass verdict:
The IUT successfully writes to the ASE Control Point characteristic with the
opcode set to 0x05 (Disable) and the specified parameters.
Test Summary
------------
BAP/UCL/SCC/BV-103-C [UCL SNK Disable in Enabling State] Passed
BAP/UCL/SCC/BV-104-C [UCL SRC Disable in Enabling or Streaming state] Passed
BAP/UCL/SCC/BV-105-C [UCL SNK Disable in Streaming State] Passed
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0
---
unit/test-bap.c | 153 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 152 insertions(+), 1 deletion(-)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index 9369983ba97d..4e518b010def 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -335,7 +335,7 @@ static void test_complete_cb(const void *user_data)
tester_test_passed();
}
-static void bap_enable(struct bt_bap_stream *stream,
+static void bap_disable(struct bt_bap_stream *stream,
uint8_t code, uint8_t reason,
void *user_data)
{
@@ -343,6 +343,50 @@ static void bap_enable(struct bt_bap_stream *stream,
tester_test_failed();
}
+static void bap_start(struct bt_bap_stream *stream,
+ uint8_t code, uint8_t reason,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ unsigned int id;
+
+ if (code) {
+ tester_test_failed();
+ return;
+ }
+
+ id = bt_bap_stream_disable(data->stream, true, bap_disable, data);
+
+ g_assert(id);
+}
+
+static void bap_enable(struct bt_bap_stream *stream,
+ uint8_t code, uint8_t reason,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ unsigned int id = 0;
+
+ if (code) {
+ tester_test_failed();
+ return;
+ }
+
+ switch (data->cfg->state) {
+ case BT_BAP_STREAM_STATE_ENABLING:
+ return;
+ case BT_BAP_STREAM_STATE_DISABLING:
+ id = bt_bap_stream_disable(data->stream, true, bap_disable,
+ data);
+ break;
+ case BT_BAP_STREAM_STATE_STREAMING:
+ id = bt_bap_stream_start(data->stream, bap_start, data);
+ break;
+ }
+
+ g_assert(id);
+}
+
static void bap_qos(struct bt_bap_stream *stream,
uint8_t code, uint8_t reason,
void *user_data)
@@ -2277,6 +2321,112 @@ static void test_scc_enable(void)
test_client, &cfg_src_enable, SCC_SRC_ENABLE);
}
+static struct test_config cfg_snk_disable = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_DISABLING
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 050101
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0501010000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x0016
+ * Data: 01010102010a00204e00409c00204e00409c00_qos
+ */
+#define ASE_SNK_DISABLE \
+ IOV_DATA(0x52, 0x22, 0x00, 0x05, 0x01, 0x01), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x05, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x02, 0x00, 0x00, 0x4c, 0x1d, 0x00, \
+ 0x00, 0x02, 0x1a, 0x00, 0x02, 0x08, 0x00, 0x40, 0x9c, \
+ 0x00)
+
+#define SCC_SNK_DISABLE \
+ SCC_SNK_ENABLE, \
+ ASE_SNK_DISABLE
+
+static struct test_config cfg_src_disable = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_DISABLING
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 050103
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0301030000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x001c
+ * Data: 030300000403020100
+ */
+#define ASE_SRC_DISABLE \
+ IOV_DATA(0x52, 0x22, 0x00, 0x05, 0x01, 0x03), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x05, 0x01, 0x03, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x02, 0x00, 0x00, 0x4c, 0x1d, 0x00, \
+ 0x00, 0x02, 0x1a, 0x00, 0x02, 0x08, 0x00, 0x40, 0x9c, \
+ 0x00)
+#define SCC_SRC_DISABLE \
+ SCC_SRC_ENABLE, \
+ ASE_SRC_DISABLE
+
+static struct test_config cfg_src_disable_streaming = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_STREAMING
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 040101
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0401010000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x0016
+ * Data: 0101010400403020100
+ */
+#define ASE_SRC_START \
+ IOV_DATA(0x52, 0x22, 0x00, 0x04, 0x01, 0x03), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x04, 0x01, 0x03, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x04, 0x00, 0x00, 0x04, 0x03, 0x02, \
+ 0x01, 0x00)
+
+#define SCC_SRC_DISABLE_STREAMING \
+ SCC_SRC_ENABLE, \
+ ASE_SRC_START, \
+ ASE_SRC_DISABLE
+
+/* Test Purpose:
+ * Verify that a Unicast Client IUT can initiate a Disable operation for an ASE
+ * in the Enabling or Streaming state.
+ *
+ * Pass verdict:
+ * The IUT successfully writes to the ASE Control Point characteristic with the
+ * opcode set to 0x05 (Disable) and the specified parameters.
+ */
+static void test_scc_disable(void)
+{
+ define_test("BAP/UCL/SCC/BV-103-C [UCL SNK Disable in Enabling State]",
+ test_client, &cfg_src_disable, SCC_SRC_DISABLE);
+ define_test("BAP/UCL/SCC/BV-104-C [UCL SRC Disable in Enabling or "
+ "Streaming state]",
+ test_client, &cfg_snk_disable, SCC_SNK_DISABLE);
+ define_test("BAP/UCL/SCC/BV-105-C [UCL SNK Disable in Streaming State]",
+ test_client, &cfg_src_disable_streaming,
+ SCC_SRC_DISABLE_STREAMING);
+}
+
static void test_scc(void)
{
test_scc_cc_lc3();
@@ -2284,6 +2434,7 @@ static void test_scc(void)
test_scc_qos_lc3();
test_scc_qos_vs();
test_scc_enable();
+ test_scc_disable();
}
int main(int argc, char *argv[])
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
4.8.8 Unicast Client Initiates Update Metadata Operation (Page 53):
Test Purpose:
Verify that a Unicast Client IUT can update the Metadata of an ASE by
initiating an Update Metadata operation.
Pass verdict:
The IUT successfully writes to the ASE Control Point characteristic with the
opcode set to 0x07 (Update Metadata) and the specified parameters.
Test Summary
------------
BAP/UCL/SCC/BV-115-C [UCL SNK Update Metadata in Enabling State] Passed
BAP/UCL/SCC/BV-116-C [UCL SRC Update Metadata in Enabling or Streaming state]
Passed
BAP/UCL/SCC/BV-117-C [UCL SNK Update Metadata in Streaming State] Passed
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0
---
unit/test-bap.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 139 insertions(+)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index fa6e65219beb..ecd5e2897093 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -2687,6 +2687,144 @@ static void test_scc_release(void)
SCC_SRC_DISABLE_RELEASE);
}
+static void bap_metadata(struct bt_bap_stream *stream,
+ uint8_t code, uint8_t reason,
+ void *user_data)
+{
+ if (code)
+ tester_test_failed();
+}
+
+static void state_enable_metadata(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ struct iovec iov = {};
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_ENABLING:
+ id = bt_bap_stream_metadata(data->stream, &iov, bap_metadata,
+ data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_snk_metadata = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_ENABLING,
+ .state_func = state_enable_metadata
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 07010100
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0701010000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x0016
+ * Data: 01010102010a00204e00409c00204e00409c00_qos
+ */
+#define ASE_SNK_METADATA \
+ IOV_DATA(0x52, 0x22, 0x00, 0x07, 0x01, 0x01, 0x00), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x07, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x05, 0x00, 0x00, 0x4c, 0x1d, 0x00, \
+ 0x00, 0x02, 0x1a, 0x00, 0x02, 0x08, 0x00, 0x40, 0x9c, \
+ 0x00)
+
+#define SCC_SNK_METADATA \
+ SCC_SNK_ENABLE, \
+ ASE_SNK_METADATA
+
+static struct test_config cfg_src_metadata = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_ENABLING,
+ .state_func = state_enable_metadata
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 07010300
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0701030000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x001c
+ * Data: 030300000403020100
+ */
+#define ASE_SRC_METADATA \
+ IOV_DATA(0x52, 0x22, 0x00, 0x07, 0x01, 0x03, 0x00), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x07, 0x01, 0x03, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x05, 0x00, 0x00, 0x4c, 0x1d, 0x00, \
+ 0x00, 0x02, 0x1a, 0x00, 0x04, 0x08, 0x00, 0x40, 0x9c, \
+ 0x00)
+#define SCC_SRC_METADATA \
+ SCC_SRC_ENABLE, \
+ ASE_SRC_METADATA
+
+static void state_start_metadata(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ struct iovec iov = {};
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_STREAMING:
+ id = bt_bap_stream_metadata(data->stream, &iov, bap_metadata,
+ data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_src_metadata_streaming = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_STREAMING,
+ .state_func = state_start_metadata
+};
+
+#define SCC_SRC_METADATA_STREAMING \
+ SCC_SRC_ENABLE, \
+ ASE_SRC_START, \
+ ASE_SRC_METADATA
+
+/* Unicast Client Initiates Update Metadata Operation
+ *
+ * Test Purpose:
+ * Verify that a Unicast Client IUT can update the Metadata of an ASE by
+ * initiating an Update Metadata operation.
+ *
+ * Pass verdict:
+ * The IUT successfully writes to the ASE Control Point characteristic with the
+ * opcode set to 0x07 (Update Metadata) and the specified parameters.
+ */
+static void test_scc_metadata(void)
+{
+ define_test("BAP/UCL/SCC/BV-115-C [UCL SNK Update Metadata in Enabling "
+ "State]",
+ test_client, &cfg_src_metadata, SCC_SRC_METADATA);
+ define_test("BAP/UCL/SCC/BV-116-C [UCL SRC Update Metadata in Enabling "
+ "or Streaming state]",
+ test_client, &cfg_snk_metadata, SCC_SNK_METADATA);
+ define_test("BAP/UCL/SCC/BV-117-C [UCL SNK Update Metadata in Streaming"
+ " State]",
+ test_client, &cfg_src_metadata_streaming,
+ SCC_SRC_METADATA_STREAMING);
+}
+
static void test_scc(void)
{
test_scc_cc_lc3();
@@ -2696,6 +2834,7 @@ static void test_scc(void)
test_scc_enable();
test_scc_disable();
test_scc_release();
+ test_scc_metadata();
}
int main(int argc, char *argv[])
--
2.43.0
From: Luiz Augusto von Dentz <[email protected]>
4.8.7 Unicast Client Initiates Release Operation (Page 51):
Test Purpose:
Verify that a Unicast Client IUT can release an ASE by initiating a Release
operation.
Pass verdict:
The IUT successfully writes to the ASE Control Point characteristic with the
opcode set to 0x08 (Release) and the specified parameters.
Test Summary
------------
BAP/UCL/SCC/BV-106-C [UCL SNK Release in Codec Configured state] Passed
BAP/UCL/SCC/BV-107-C [UCL SRC Release in Codec Configured state] Passed
BAP/UCL/SCC/BV-108-C [UCL SNK Release in QoS Configured state] Passed
BAP/UCL/SCC/BV-109-C [UCL SRC Release in QoS Configured state] Passed
BAP/UCL/SCC/BV-110-C [UCL SNK Release in Enabling state] Passed
BAP/UCL/SCC/BV-111-C [UCL SRC Release in Enabling or Streaming state] Passed
BAP/UCL/SCC/BV-112-C [UCL SNK Release in Streaming state] Passed
BAP/UCL/SCC/BV-113-C [UCL SNK Release in Disabling state] Passed
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
---
unit/test-bap.c | 287 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 274 insertions(+), 13 deletions(-)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index 4e518b010def..fa6e65219beb 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -40,6 +40,7 @@ struct test_config {
bool src;
bool vs;
uint8_t state;
+ bt_bap_state_func_t state_func;
};
struct test_data {
@@ -347,17 +348,8 @@ static void bap_start(struct bt_bap_stream *stream,
uint8_t code, uint8_t reason,
void *user_data)
{
- struct test_data *data = user_data;
- unsigned int id;
-
- if (code) {
+ if (code)
tester_test_failed();
- return;
- }
-
- id = bt_bap_stream_disable(data->stream, true, bap_disable, data);
-
- g_assert(id);
}
static void bap_enable(struct bt_bap_stream *stream,
@@ -507,6 +499,10 @@ static void test_client(const void *user_data)
bt_bap_ready_register(data->bap, bap_ready, data, NULL);
+ if (data->cfg && data->cfg->state_func)
+ bt_bap_state_register(data->bap, data->cfg->state_func, NULL,
+ data, NULL);
+
bt_bap_attach(data->bap, data->client);
}
@@ -2371,18 +2367,35 @@ static struct test_config cfg_src_disable = {
IOV_DATA(0x52, 0x22, 0x00, 0x05, 0x01, 0x03), \
IOV_DATA(0x1b, 0x22, 0x00, 0x05, 0x01, 0x03, 0x00, 0x00), \
IOV_NULL, \
- IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x02, 0x00, 0x00, 0x4c, 0x1d, 0x00, \
- 0x00, 0x02, 0x1a, 0x00, 0x02, 0x08, 0x00, 0x40, 0x9c, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x05, 0x00, 0x00, 0x4c, 0x1d, 0x00, \
+ 0x00, 0x02, 0x1a, 0x00, 0x04, 0x08, 0x00, 0x40, 0x9c, \
0x00)
#define SCC_SRC_DISABLE \
SCC_SRC_ENABLE, \
ASE_SRC_DISABLE
+static void state_start_disable(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_STREAMING:
+ id = bt_bap_stream_disable(data->stream, true, bap_disable,
+ data);
+ g_assert(id);
+ break;
+ }
+}
+
static struct test_config cfg_src_disable_streaming = {
.cc = LC3_CONFIG_16_2,
.qos = LC3_QOS_16_2_1,
.src = true,
- .state = BT_BAP_STREAM_STATE_STREAMING
+ .state = BT_BAP_STREAM_STATE_STREAMING,
+ .state_func = state_start_disable
};
/* ATT: Write Command (0x52) len 23
@@ -2427,6 +2440,253 @@ static void test_scc_disable(void)
SCC_SRC_DISABLE_STREAMING);
}
+static void bap_release(struct bt_bap_stream *stream,
+ uint8_t code, uint8_t reason,
+ void *user_data)
+{
+ if (code)
+ tester_test_failed();
+}
+
+static void state_cc_release(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_CONFIG:
+ id = bt_bap_stream_release(data->stream, bap_release, data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_src_cc_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = QOS_UCAST,
+ .src = true,
+ .state_func = state_cc_release,
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 080103
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0801030000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x001c
+ * Data: 0300
+ */
+#define ASE_SRC_RELEASE \
+ IOV_DATA(0x52, 0x22, 0x00, 0x08, 0x01, 0x03), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x08, 0x01, 0x03, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x00)
+
+#define SCC_SRC_CC_RELEASE \
+ SCC_SRC_16_2, \
+ ASE_SRC_RELEASE
+
+static struct test_config cfg_snk_cc_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = QOS_UCAST,
+ .snk = true,
+ .state_func = state_cc_release,
+};
+
+/* ATT: Write Command (0x52) len 23
+ * Handle: 0x0022
+ * Data: 080101
+ * ATT: Handle Value Notification (0x1b) len 7
+ * Handle: 0x0022
+ * Data: 0801010000
+ * ATT: Handle Value Notification (0x1b) len 37
+ * Handle: 0x0016
+ * Data: 0300
+ */
+#define ASE_SNK_RELEASE \
+ IOV_DATA(0x52, 0x22, 0x00, 0x08, 0x01, 0x01), \
+ IOV_DATA(0x1b, 0x22, 0x00, 0x08, 0x01, 0x01, 0x00, 0x00), \
+ IOV_NULL, \
+ IOV_DATA(0x1b, 0x16, 0x00, 0x03, 0x00)
+
+#define SCC_SNK_CC_RELEASE \
+ SCC_SNK_16_2, \
+ ASE_SNK_RELEASE
+
+static void state_qos_release(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_QOS:
+ id = bt_bap_stream_release(data->stream, bap_release, data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_src_qos_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+ .state_func = state_qos_release,
+};
+
+#define SCC_SRC_QOS_RELEASE \
+ SCC_SRC_16_2_1, \
+ ASE_SRC_RELEASE
+
+static struct test_config cfg_snk_qos_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_QOS,
+ .state_func = state_qos_release,
+};
+
+#define SCC_SNK_QOS_RELEASE \
+ SCC_SNK_16_2_1, \
+ ASE_SNK_RELEASE
+
+static void state_enable_release(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_ENABLING:
+ id = bt_bap_stream_release(data->stream, bap_release, data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_src_enable_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_ENABLING,
+ .state_func = state_enable_release,
+};
+
+#define SCC_SRC_ENABLE_RELEASE \
+ SCC_SRC_ENABLE, \
+ ASE_SRC_RELEASE
+
+static struct test_config cfg_snk_enable_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .snk = true,
+ .state = BT_BAP_STREAM_STATE_ENABLING,
+ .state_func = state_enable_release,
+};
+
+#define SCC_SNK_ENABLE_RELEASE \
+ SCC_SNK_ENABLE, \
+ ASE_SNK_RELEASE
+
+static void state_start_release(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_STREAMING:
+ id = bt_bap_stream_release(data->stream, bap_release, data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_src_start_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_STREAMING,
+ .state_func = state_start_release,
+};
+
+#define SCC_SRC_START_RELEASE \
+ SCC_SRC_ENABLE, \
+ ASE_SRC_START, \
+ ASE_SRC_RELEASE
+
+static void state_disable_release(struct bt_bap_stream *stream,
+ uint8_t old_state, uint8_t new_state,
+ void *user_data)
+{
+ struct test_data *data = user_data;
+ uint8_t id;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_DISABLING:
+ id = bt_bap_stream_release(data->stream, bap_release, data);
+ g_assert(id);
+ break;
+ }
+}
+
+static struct test_config cfg_src_disable_release = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = LC3_QOS_16_2_1,
+ .src = true,
+ .state = BT_BAP_STREAM_STATE_DISABLING,
+ .state_func = state_disable_release,
+};
+
+#define SCC_SRC_DISABLE_RELEASE \
+ SCC_SRC_DISABLE, \
+ ASE_SRC_RELEASE
+
+/* Test Purpose:
+ * Verify that a Unicast Client IUT can release an ASE by initiating a Release
+ * operation.
+ *
+ * Pass verdict:
+ * The IUT successfully writes to the ASE Control Point characteristic with the
+ * opcode set to 0x08 (Release) and the specified parameters.
+ */
+static void test_scc_release(void)
+{
+ define_test("BAP/UCL/SCC/BV-106-C [UCL SNK Release in Codec Configured"
+ " state]",
+ test_client, &cfg_src_cc_release, SCC_SRC_CC_RELEASE);
+ define_test("BAP/UCL/SCC/BV-107-C [UCL SRC Release in Codec Configured"
+ " state]",
+ test_client, &cfg_snk_cc_release, SCC_SNK_CC_RELEASE);
+ define_test("BAP/UCL/SCC/BV-108-C [UCL SNK Release in QoS Configured"
+ " state]",
+ test_client, &cfg_src_qos_release, SCC_SRC_QOS_RELEASE);
+ define_test("BAP/UCL/SCC/BV-109-C [UCL SRC Release in QoS Configured"
+ " state]",
+ test_client, &cfg_snk_qos_release, SCC_SNK_QOS_RELEASE);
+ define_test("BAP/UCL/SCC/BV-110-C [UCL SNK Release in Enabling state]",
+ test_client, &cfg_src_enable_release,
+ SCC_SRC_ENABLE_RELEASE);
+ define_test("BAP/UCL/SCC/BV-111-C [UCL SRC Release in Enabling or"
+ " Streaming state]",
+ test_client, &cfg_snk_enable_release,
+ SCC_SNK_ENABLE_RELEASE);
+ define_test("BAP/UCL/SCC/BV-112-C [UCL SNK Release in Streaming state]",
+ test_client, &cfg_src_start_release,
+ SCC_SRC_START_RELEASE);
+ define_test("BAP/UCL/SCC/BV-113-C [UCL SNK Release in Disabling state]",
+ test_client, &cfg_src_disable_release,
+ SCC_SRC_DISABLE_RELEASE);
+}
+
static void test_scc(void)
{
test_scc_cc_lc3();
@@ -2435,6 +2695,7 @@ static void test_scc(void)
test_scc_qos_vs();
test_scc_enable();
test_scc_disable();
+ test_scc_release();
}
int main(int argc, char *argv[])
--
2.43.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=806820
---Test result---
Test Summary:
CheckPatch FAIL 5.64 seconds
GitLint PASS 2.80 seconds
BuildEll PASS 24.28 seconds
BluezMake PASS 734.05 seconds
MakeCheck PASS 11.65 seconds
MakeDistcheck PASS 160.10 seconds
CheckValgrind PASS 222.68 seconds
CheckSmatch PASS 327.47 seconds
bluezmakeextell PASS 102.44 seconds
IncrementalBuild PASS 5000.55 seconds
ScanBuild WARNING 976.07 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,v3,2/8] test-bap: Introduce QoS tests for LC3
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#78:
Verify that a Unicast Client IUT can initiate a Config QoS operation for the
/github/workspace/src/src/13479151.patch total: 0 errors, 1 warnings, 992 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13479151.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,v3,3/8] test-bap: Add SCC Config QoS, VS tests
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#77:
Verify that a Unicast Client IUT can initiate a Config QoS operation for a
/github/workspace/src/src/13479149.patch total: 0 errors, 1 warnings, 54 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13479149.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,v3,4/8] test-bap: Add SCC Enable tests
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#77:
Verify that a Unicast Client IUT can initiate an Enable operation for an ASE
/github/workspace/src/src/13479150.patch total: 0 errors, 1 warnings, 116 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13479150.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,v3,5/8] test-bap: Add SCC Disable tests
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#77:
Verify that a Unicast Client IUT can initiate a Disable operation for an ASE
/github/workspace/src/src/13479152.patch total: 0 errors, 1 warnings, 177 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13479152.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,v3,7/8] test-bap: Add SCC Release tests
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#77:
Verify that a Unicast Client IUT can release an ASE by initiating a Release
/github/workspace/src/src/13479154.patch total: 0 errors, 1 warnings, 333 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13479154.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,v3,8/8] test-bap: Add SCC Update Metadata tests
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#81:
The IUT successfully writes to the ASE Control Point characteristic with the
/github/workspace/src/src/13479155.patch total: 0 errors, 1 warnings, 151 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13479155.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
src/shared/bap.c:4696:23: warning: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'lpac')
if (!match.rpac && (lpac->type != BT_BAP_BCAST_SOURCE))
^~~~~~~~~~
1 warning generated.
---
Regards,
Linux Bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:
On Mon, 4 Dec 2023 17:15:20 -0500 you wrote:
> From: Luiz Augusto von Dentz <[email protected]>
>
> This adds the QoS preset definitions as per BAP specification.
> ---
> src/shared/lc3.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 153 insertions(+)
Here is the summary with links:
- [BlueZ,v3,1/8] shared/lc3: Add QoS definitions
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e3d9aad7d6e6
- [BlueZ,v3,2/8] test-bap: Introduce QoS tests for LC3
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9c3824db2aa5
- [BlueZ,v3,3/8] test-bap: Add SCC Config QoS, VS tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f93fec890447
- [BlueZ,v3,4/8] test-bap: Add SCC Enable tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6f957d3b6c43
- [BlueZ,v3,5/8] test-bap: Add SCC Disable tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=58805e4f28a3
- [BlueZ,v3,6/8] shared/bap: Fix possible crash when freeing requests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f10faf387d7f
- [BlueZ,v3,7/8] test-bap: Add SCC Release tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5d2277071237
- [BlueZ,v3,8/8] test-bap: Add SCC Update Metadata tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9b322d3a52a1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html