From patchwork Fri Apr 4 19:39:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878289 Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 027D522331F for ; Fri, 4 Apr 2025 19:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795608; cv=none; b=qTF3LGP4DE2QsK8lyV4eER26ZGyMtPwcFql7K0p1chbkqG/XPWRKEjmOWcwKzJXDuLXPULLzakyC2Luwo2PHMwkNrC0Wdxm0gbE0Na1LKJw9jRgFSSGFnoBJvMMC6TZYfCoVInbwhTG/TeZ34MW8jRFSGYp111XTdZk1snXzuyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795608; c=relaxed/simple; bh=+ZvmQNa5yIl86i4EQl9vxmXMU/IuzIO5hvKbXs7M2Bc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LNQdJaB2lilpBf+8Z5Z0YdZFY7H9WZgA0NmQYmsymUq6PGpoXpC+miur1cfGD1jBbW3h2rVVjwqOa8PNGAO2tKx4vhY1+ew5jg6fL6b7FMScYoCJL2RGf5bZE/gbbREsZuAeM+HHMN/sn+hxyA2zkaG0+0pDKZJ5Yor43sm8DnM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Zffd79xc; arc=none smtp.client-ip=209.85.221.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zffd79xc" Received: by mail-vk1-f176.google.com with SMTP id 71dfb90a1353d-5242f137a1eso1063742e0c.1 for ; Fri, 04 Apr 2025 12:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795604; x=1744400404; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xd6U/z0kBI9dOurDIgmF95BXv3OdYTfiJ7bE4h6+gGM=; b=Zffd79xczmya+osZmJ3g7IjbQA/JPOdoqHzzpnutr096rTXFDz7mnB6cHlvAC8PL/i 7ibPbr9QBE51DQ3hQpOF+impo6lxsoNjEu+Qxe56wV9DGec/eJkzEV2FQ7sWmvrpJSvL fQ66c47hM8PiSLn3Bms8x5nNKMAH9PGOa5ghdhe3GghmMFzrpYe+8O2qiLIfcRozNV6b JcBgEMlpF2RkG3mo/xT/32u32bbqRUOabSvhzlbLibkX0uIFnn/hvZ8IfhcyI1drrZKM 2wrvBh4mz3EgXcFepZumwBR3o+a3lbzJYTpp5He/oGJxd59K00IIHRLzRCyigdEeBn3b 0srg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795604; x=1744400404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xd6U/z0kBI9dOurDIgmF95BXv3OdYTfiJ7bE4h6+gGM=; b=SrGAoGFTpkGaQUHJrKCBe78Prlj8/6YuE/4Otzk6b3AR5RrOMKHVB/ypyHYM5I2G61 0OeMkXBQUZrsKGkaS7/5twi7O+sydF6dMLMlCkBny81lUg4HHlC9F+1b4QKk7vnOgv3A 3ezDIo5bcmAH66qrK0qk/KazbxBcrGRwjhb/YuRU8VXS5gLnpzeBQsdDz6rhLnv4FWAW IA81uUyTyrezJXtCZuSRBtB/FqkVylVuaPu0XSaUFEO0Xi4GSMybGpsGKtiLPVSM4KOF wygIjTAQQVxUTCWHoWEGMiQmtYUXuFv8KR91gzSfI94TXRevv6sG18Lq88o2Uc9UOqWA 2llg== X-Gm-Message-State: AOJu0YxPonwQdSvC+/5BrGRvrpButkjeScl2R++4LuI4XIVjoMYpBB/2 IGkMOcBIS9di1XCB8UkE59RIZ+M/mDGjkYAtdbffonWGEE1WiHme/RtrJsAvSBg= X-Gm-Gg: ASbGnctz1vEla0qTVoKrIHUL+z8vB4AUyry+6HfrFz/qKqrLEbBa250JTkENWUZJMoO HosPiNwx4XvIdxcf1DL9pN7cE4NfWKVk4f83LiIpKPwJ5wVOcC43BiXkfJ3cVvSLXav3EijLLYu ha7reqNSUf6FviCK5L89hArWKkW+HK3nQNnEi8RhU7ymDMCYKxD75QphsdpiFuXynMDV2lkNqgc j+mmNhlXalPSDos7YI/YL3Oi92HBdl5d0Mp9gTl8ADRVSW1j/SazBc+hIhRVYNACFK0NIXs2aNO cQ8InV+yHv7dkMnS5WfdS+txAsJbwvuTY14vCgAs/g3DB7rVTtDyoQqGoGLL00w7smKOkfx1Xk/ rTg7+hLVLWFtODA== X-Google-Smtp-Source: AGHT+IG+E1GwtX5QZkNchzKIUA+HuZ5wOl76IlWL5yGdPk4uZMwaPjViVNzPMQcm8/2p3lm+2Z/Q2w== X-Received: by 2002:a05:6102:1528:b0:4bb:9b46:3f8a with SMTP id ada2fe7eead31-4c8553821b7mr5377573137.2.1743795603972; Fri, 04 Apr 2025 12:40:03 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:03 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 01/11] test-bap: Introduce DISC tests for LC3 Date: Fri, 4 Apr 2025 15:39:39 -0400 Message-ID: <20250404193959.359008-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz 4.7.2 Unicast Server – Audio Capability Exposure (Page 32): Test Purpose Verify that a Unicast Server IUT can allow audio capability discovery with an Audio Sink reading the values of the Sink PAC characteristic and the Sink Audio Locations characteristic on the IUT, or with an Audio Source reading the values of the Source PAC characteristic and the Source Audio Locations characteristic on the IUT. Test Summary ------------ BAP/USR/DISC/BV-01-C Passed BAP/USR/DISC/BV-02-C Passed BAP/USR/DISC/BV-06-C Passed BAP/USR/DISC/BV-07-C Passed BAP/USR/DISC/BV-03-C Passed BAP/USR/DISC/BV-04-C Passed BAP/USR/DISC/BV-05-C Passed Total: 7, Passed: 7 (100.0%), Failed: 0, Not Run: 0 --- src/shared/lc3.h | 2 +- unit/test-bap.c | 347 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 299 insertions(+), 50 deletions(-) diff --git a/src/shared/lc3.h b/src/shared/lc3.h index e7a9277ec349..a6f65eedecc5 100644 --- a/src/shared/lc3.h +++ b/src/shared/lc3.h @@ -48,7 +48,7 @@ #define LC3_FRAME_COUNT (LC3_TYPE_BASE + 4) #define LC3_CAPABILITIES(_freq, _duration, _chan_count, _len_min, _len_max) \ - UTIL_IOV_INIT(0x02, LC3_FREQ, _freq, _freq >> 8, \ + UTIL_IOV_INIT(0x03, LC3_FREQ, _freq, _freq >> 8, \ 0x02, LC3_DURATION, _duration, \ 0x02, LC3_CHAN_COUNT, _chan_count, \ 0x05, LC3_FRAME_LEN, _len_min, _len_min >> 8, \ diff --git a/unit/test-bap.c b/unit/test-bap.c index 0c190d7fe15a..cabb9b296ee2 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -30,6 +30,7 @@ #include "src/shared/att.h" #include "src/shared/gatt-db.h" #include "src/shared/gatt-client.h" +#include "src/shared/gatt-server.h" #include "src/shared/bap.h" #include "src/shared/lc3.h" @@ -48,12 +49,16 @@ struct test_config { struct test_data { struct bt_gatt_client *client; + struct bt_gatt_server *server; struct gatt_db *db; + struct queue *ccc_states; struct bt_bap *bap; + unsigned int id; struct bt_bap_pac *snk; struct bt_bap_pac *src; struct bt_bap_pac *bsrc; struct bt_bap_pac *bsnk; + struct bt_bap_pac_qos *qos; struct iovec *base; struct iovec *caps; struct test_config *cfg; @@ -62,6 +67,19 @@ struct test_data { struct iovec *iov; }; +struct notify { + uint16_t handle, ccc_handle; + uint8_t *value; + uint16_t len; + bt_gatt_server_conf_func_t conf; + void *user_data; +}; + +struct ccc_state { + uint16_t handle; + uint16_t value; +}; + /* * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms @@ -71,6 +89,12 @@ struct test_data { static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY, 3u, 26, 240); +static struct bt_bap_pac_qos lc3_qos = { + .location = 0x00000003, + .supported_context = 0x0fff, + .context = 0x0fff +}; + #define iov_data(args...) ((const struct iovec[]) { args }) #define define_test(name, setup, function, _cfg, args...) \ @@ -78,6 +102,7 @@ static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY, const struct iovec iov[] = { args }; \ static struct test_data data; \ data.caps = &lc3_caps; \ + data.qos = &lc3_qos; \ data.cfg = _cfg; \ data.iovcnt = ARRAY_SIZE(iov_data(args)); \ data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \ @@ -284,7 +309,7 @@ static const struct iovec setup_data[] = { * Handle: 0x0022 * Error: Attribute Not Found (0x0a) */ - IOV_DATA(0x01, 0x08, 0x23, 0x00, 0x0a), + IOV_DATA(0x01, 0x08, 0x22, 0x00, 0x0a), /* ACL Data TX: Handle 42 flags 0x00 dlen 11 * ATT: Read By Type Request (0x08) len 6 * Handle range: 0x0001-0xffff @@ -338,6 +363,172 @@ static void test_setup(const void *user_data) gatt_db_unref(db); } +static bool ccc_state_match(const void *a, const void *b) +{ + const struct ccc_state *ccc = a; + uint16_t handle = PTR_TO_UINT(b); + + return ccc->handle == handle; +} + +static struct ccc_state *find_ccc_state(struct test_data *data, + uint16_t handle) +{ + return queue_find(data->ccc_states, ccc_state_match, + UINT_TO_PTR(handle)); +} + +static struct ccc_state *get_ccc_state(struct test_data *data, + uint16_t handle) +{ + struct ccc_state *ccc; + + ccc = find_ccc_state(data, handle); + if (ccc) + return ccc; + + ccc = new0(struct ccc_state, 1); + ccc->handle = handle; + queue_push_tail(data->ccc_states, ccc); + + return ccc; +} + +static void gatt_notify_cb(struct gatt_db_attribute *attrib, + struct gatt_db_attribute *ccc, + const uint8_t *value, size_t len, + struct bt_att *att, void *user_data) +{ + struct test_data *data = user_data; + uint16_t handle = gatt_db_attribute_get_handle(attrib); + + if (!data->server) + return; + + if (!bt_gatt_server_send_notification(data->server, + handle, value, len, false)) + printf("%s: Failed to send notification\n", __func__); +} + +static void gatt_ccc_read_cb(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offest, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct test_data *data = user_data; + struct ccc_state *ccc; + uint16_t handle; + uint8_t ecode = 0; + uint16_t value = 0; + + handle = gatt_db_attribute_get_handle(attrib); + + ccc = get_ccc_state(data, handle); + if (!ccc) { + ecode = BT_ATT_ERROR_UNLIKELY; + goto done; + } + + value = cpu_to_le16(ccc->value); + +done: + gatt_db_attribute_read_result(attrib, id, ecode, (void *)&value, + sizeof(value)); +} + +static void test_setup_pacs(struct test_data *data) +{ + if (!data->cfg) + return; + + if (data->cfg->src) { + if (data->cfg->vs) + data->snk = bt_bap_add_vendor_pac(data->db, + "test-bap-snk", + BT_BAP_SINK, 0x0ff, + 0x0001, 0x0001, + NULL, data->caps, NULL); + else + data->snk = bt_bap_add_pac(data->db, "test-bap-snk", + BT_BAP_SINK, LC3_ID, + NULL, data->caps, NULL); + g_assert(data->snk); + } + + if (data->cfg->snk) { + if (data->cfg->vs) + data->src = bt_bap_add_vendor_pac(data->db, + "test-bap-src", + BT_BAP_SOURCE, 0x0ff, + 0x0001, 0x0001, + NULL, data->caps, NULL); + else + data->src = bt_bap_add_pac(data->db, "test-bap-src", + BT_BAP_SOURCE, LC3_ID, + NULL, data->caps, NULL); + g_assert(data->src); + } +} + +static void setup_complete_cb(const void *user_data) +{ + tester_setup_complete(); +} + +static void test_setup_server(const void *user_data) +{ + struct test_data *data = (void *)user_data; + struct bt_att *att; + struct gatt_db *db; + struct io *io; + + io = tester_setup_io(setup_data, ARRAY_SIZE(setup_data)); + g_assert(io); + + tester_io_set_complete_func(setup_complete_cb); + + db = gatt_db_new(); + g_assert(db); + + gatt_db_ccc_register(db, gatt_ccc_read_cb, NULL, gatt_notify_cb, data); + + data->ccc_states = queue_new(); + + /* If there is no configuration, add a sink PAC since otherwise bt_bap + * won't even register the required services. + */ + if (!data->cfg) { + data->snk = bt_bap_add_pac(db, "test-bap-snk", + BT_BAP_SINK, LC3_ID, + data->qos, data->caps, + NULL); + data->src = bt_bap_add_pac(db, "test-bap-src", + BT_BAP_SOURCE, LC3_ID, + data->qos, data->caps, + NULL); + g_assert(data->snk); + g_assert(data->src); + } else { + test_setup_pacs(data); + } + + att = bt_att_new(io_get_fd(io), false); + g_assert(att); + + bt_att_set_debug(att, BT_ATT_DEBUG, print_debug, "bt_att:", NULL); + + data->server = bt_gatt_server_new(db, att, 64, 0); + g_assert(data->server); + + bt_gatt_server_set_debug(data->server, print_debug, "bt_gatt_server:", + NULL); + + tester_io_send(); + + bt_att_unref(att); + gatt_db_unref(db); +} + static void test_complete_cb(const void *user_data) { tester_test_passed(); @@ -455,40 +646,6 @@ static void bap_ready(struct bt_bap *bap, void *user_data) bt_bap_foreach_pac(bap, BT_BAP_SOURCE, pac_found, user_data); } -static void test_client_config(struct test_data *data) -{ - if (!data->cfg) - return; - - if (data->cfg->src) { - if (data->cfg->vs) - data->snk = bt_bap_add_vendor_pac(data->db, - "test-bap-snk", - BT_BAP_SINK, 0x0ff, - 0x0001, 0x0001, - NULL, data->caps, NULL); - else - data->snk = bt_bap_add_pac(data->db, "test-bap-snk", - BT_BAP_SINK, LC3_ID, - NULL, data->caps, NULL); - g_assert(data->snk); - } - - if (data->cfg->snk) { - if (data->cfg->vs) - data->src = bt_bap_add_vendor_pac(data->db, - "test-bap-src", - BT_BAP_SOURCE, 0x0ff, - 0x0001, 0x0001, - NULL, data->caps, NULL); - else - data->src = bt_bap_add_pac(data->db, "test-bap-src", - BT_BAP_SOURCE, LC3_ID, - NULL, data->caps, NULL); - g_assert(data->src); - } -} - static void test_client(const void *user_data) { struct test_data *data = (void *)user_data; @@ -502,7 +659,7 @@ static void test_client(const void *user_data) data->db = gatt_db_new(); g_assert(data->db); - test_client_config(data); + test_setup_pacs(data); data->bap = bt_bap_new(data->db, bt_gatt_client_get_db(data->client)); g_assert(data->bap); @@ -697,6 +854,7 @@ static void test_teardown(const void *user_data) { struct test_data *data = (void *)user_data; + bt_bap_unregister(data->id); bt_bap_unref(data->bap); bt_gatt_client_unref(data->client); util_iov_free(data->iov, data->iovcnt); @@ -708,6 +866,8 @@ static void test_teardown(const void *user_data) bt_bap_remove_pac(data->bsrc); bt_bap_remove_pac(data->bsnk); gatt_db_unref(data->db); + bt_gatt_server_unref(data->server); + data->server = NULL; queue_destroy(data->streams, NULL); @@ -741,7 +901,7 @@ static void test_teardown(const void *user_data) * 1 channel (0x01) * 2 channels (0x02) * Codec Specific Capabilities #3: len 0x05 type 0x04 - * Frame Length: 30 (0x001e) - 240 (0x00f0) + * Frame Length: 26 (0x001a) - 240 (0x00f0) * ATT: Read Request (0x0a) len 2 * Handle: 0x0006 Type: Sink Audio Location (0x2bca) * ATT: Read Response (0x0b) len 4 @@ -760,7 +920,7 @@ static void test_teardown(const void *user_data) #define DISC_SNK_LC3 \ DISC_SNK_PAC(0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x01, \ 0xff, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x05, 0x04, \ - 0x1e, 0x00, 0xf0, 0x00, 0x00) + 0x1a, 0x00, 0xf0, 0x00, 0x00) /* ATT: Read Request (0x0a) len 2 * Handle: 0x0009 Type: Source PAC (0x2bcb) @@ -789,7 +949,7 @@ static void test_teardown(const void *user_data) * 1 channel (0x01) * 2 channels (0x02) * Codec Specific Capabilities #3: len 0x05 type 0x04 - * Frame Length: 30 (0x001e) - 240 (0x00f0) + * Frame Length: 26 (0x001e) - 240 (0x00f0) * ATT: Read Request (0x0a) len 2 * Handle: 0x000c Type: Source Audio Location (0x2bcc) * ATT: Read Response (0x0b) len 4 @@ -809,39 +969,39 @@ static void test_teardown(const void *user_data) #define DISC_SRC_LC3 \ DISC_SRC_PAC(0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x01, \ 0xff, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x05, 0x04, \ - 0x1e, 0x00, 0xf0, 0x00, 0x00) + 0x1a, 0x00, 0xf0, 0x00, 0x00) /* ATT: Read Request (0x0a) len 2 * Handle: 0x000f Type: Available Audio Contexts (0x2bcd) * ATT: Read Response (0x0b) len 4 - * Value: ff0f0e00 + * Value: ff0fff0f * Handle: 0x000f Type: Available Audio Contexts (0x2bcd) */ #define DISC_CTX(_caps...) \ DISC_SRC_PAC(_caps), \ IOV_DATA(0x0a, 0x0f, 0x00), \ - IOV_DATA(0x0b, 0xff, 0x0f, 0x0e, 0x00) + IOV_DATA(0x0b, 0xff, 0x0f, 0xff, 0x0f) #define DISC_CTX_LC3 \ DISC_CTX(0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x01, \ 0xff, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x05, 0x04, \ - 0x1e, 0x00, 0xf0, 0x00, 0x00) + 0x1a, 0x00, 0xf0, 0x00, 0x00) /* ATT: Read Request (0x0a) len 2 * Handle: 0x0012 Type: Supported Audio Contexts (0x2bce) * ATT: Read Response (0x0b) len 4 - * Value: ff0f0e00 + * Value: ff0fff0f * Handle: 0x0012 Type: Supported Audio Contexts (0x2bce) */ #define DISC_SUP_CTX(_caps...) \ DISC_CTX(_caps), \ IOV_DATA(0x0a, 0x12, 0x00), \ - IOV_DATA(0x0b, 0xff, 0x0f, 0x0e, 0x00) + IOV_DATA(0x0b, 0xff, 0x0f, 0xff, 0x0f) #define DISC_SUP_CTX_LC3 \ DISC_SUP_CTX(0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x01, \ 0xff, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x05, 0x04, \ - 0x1e, 0x00, 0xf0, 0x00, 0x00) + 0x1a, 0x00, 0xf0, 0x00, 0x00) /* ATT: Read Request (0x0a) len 2 * Handle: 0x0016 Type: Sink ASE (0x2bc4) @@ -878,7 +1038,7 @@ static void test_teardown(const void *user_data) #define DISC_SNK_ASE_LC3 \ DISC_SNK_ASE(0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x01, \ 0xff, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x05, 0x04, \ - 0x1e, 0x00, 0xf0, 0x00, 0x00) + 0x1a, 0x00, 0xf0, 0x00, 0x00) /* ATT: Read Request (0x0a) len 2 * Handle: 0x001c Type: Source ASE (0x2bc5) @@ -922,9 +1082,13 @@ static void test_teardown(const void *user_data) #define DISC_SRC_ASE_LC3 \ DISC_SRC_ASE(0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x01, \ 0xff, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x05, 0x04, \ - 0x1e, 0x00, 0xf0, 0x00, 0x00) + 0x1a, 0x00, 0xf0, 0x00, 0x00) -static void test_disc(void) +#define DISC_ASE_LC3 \ + DISC_SNK_ASE_LC3, \ + DISC_SRC_ASE_LC3 + +static void test_ucl_disc(void) { /* The IUT discovers the characteristics specified in the PAC * Characteristic and Location Characteristic columns in Table 4.4. @@ -964,6 +1128,91 @@ static void test_disc(void) DISC_SRC_ASE_LC3); } +static void bap_attached(struct bt_bap *bap, void *user_data) +{ + struct test_data *data = (void *)user_data; + + if (tester_use_debug()) + tester_debug("bap %p session attached", bap); + + data->bap = bap; + + bt_bap_set_debug(data->bap, print_debug, "bt_bap:", NULL); + + if (data->cfg && data->cfg->state_func) + bt_bap_state_register(data->bap, data->cfg->state_func, NULL, + data, NULL); +} + +static void test_server(const void *user_data) +{ + struct test_data *data = (void *)user_data; + struct io *io; + + io = tester_setup_io(data->iov, data->iovcnt); + g_assert(io); + + tester_io_set_complete_func(test_complete_cb); + + test_setup_pacs(data); + + data->id = bt_bap_register(bap_attached, NULL, data); + g_assert(data->id); + + tester_io_send(); +} + +static void test_usr_disc(void) +{ + /* BAP/USR/DISC/BV-01-C [Expose Audio Sink Capabilities] + * BAP/USR/DISC/BV-02-C [Expose Audio Source Capabilities] + * + * The specified PAC Characteristic and the Location Characteristic, + * if supported, are read on the IUT. + */ + define_test("BAP/USR/DISC/BV-01-C", test_setup_server, test_server, + NULL, DISC_SNK_LC3); + define_test("BAP/USR/DISC/BV-02-C", test_setup_server, test_server, + NULL, DISC_SRC_LC3); + + /* BAP/UCL/DISC/BV-06-C [Discover Available Audio Contexts] + * + * The IUT successfully reads the value of the Available Audio Contexts + * characteristic on the Lower Tester. + */ + define_test("BAP/USR/DISC/BV-06-C", test_setup_server, test_server, + NULL, DISC_CTX_LC3); + + /* BAP/USR/DISC/BV-07-C [Expose Supported Audio Contexts] + * + * The IUT successfully returns the value of its Supported Audio + * Contexts characteristic when read by the Lower Tester. + */ + define_test("BAP/USR/DISC/BV-07-C", test_setup_server, test_server, + NULL, DISC_SUP_CTX_LC3); + + /* BAP/USR/DISC/BV-03-C [Expose Sink ASE_ID] + * BAP/USR/DISC/BV-04-C [Expose Source ASE_ID] + * BAP/USR/DISC/BV-05-C [Expose Sink and Source ASE_ID] + * + * The IUT successfully returns the values of each ASE characteristic + * read by the Lower Tester. The value of the ASE_ID field is unique + * for each ASE characteristic. + */ + define_test("BAP/USR/DISC/BV-03-C", test_setup_server, test_server, + NULL, DISC_SNK_ASE_LC3); + define_test("BAP/USR/DISC/BV-04-C", test_setup_server, test_server, + NULL, DISC_SRC_ASE_LC3); + define_test("BAP/USR/DISC/BV-05-C", test_setup_server, test_server, + NULL, DISC_ASE_LC3); +} + +static void test_disc(void) +{ + test_ucl_disc(); + test_usr_disc(); +} + /* ATT: Write Command (0x52) len 23 * Handle: 0x0022 * Data: 0101010202_cfg From patchwork Fri Apr 4 19:39:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878641 Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 653BE223705 for ; Fri, 4 Apr 2025 19:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795611; cv=none; b=AC0Gdm8Fn2Nf683wChxWxUpILwmKMO/g9ilMcrXyqwSbtQkf2YGfB9MsSBsxcgx9OJPGbjkuuYHTu2wpwbOi/ar3Phg3KutdVdKwVC5ht7y7v2pH6eJZMgxvrLNyfgkcyxFjJqpE0TM7qAu2LSE7r7mX1K0D4HZ4qvSC7NFLJK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795611; c=relaxed/simple; bh=lV9Er+Su+VuJRn8I3P/Z5RcbhKDljCbZ7qikSHJHQD8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QIGwMULspHRXl756ZFjdpgy9SZ3hr8kJX70C/v5W0fsY2sHm49ckFH12Q6y2n7R2Uq6JakdXFA1jpYCSq0D9+2cnyesljJzHi04nXIc0Lh2lVXM7uXReTE6qs8WzyTQV8QgzNtMSpWyqS2hlKvZW90ZHqw6EgdF4Nc3XqDuJx7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QxGkPVH5; arc=none smtp.client-ip=209.85.222.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QxGkPVH5" Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-86d377306ddso1102530241.2 for ; Fri, 04 Apr 2025 12:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795606; x=1744400406; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oH5zIz3fH+HzePqUrVUnHeTuTck/L6WwKXLj9XMwPLs=; b=QxGkPVH5Ad+am0FDg8bIva2GiPrZWlHTAd1MqfTE6EiPlcYKmArVBkvTF1pKgaGQkD ANxh2Ea/hb7rdD2ovus8NZeGG1+glQLYMnWPbONrscjlpp+nUz/h43LFl0ttHfXi1VOR DTcdSoJCtA9AFbWuDjflsOyBkIQ6i9L1YCiF6xkDc+2ObG+M02mVY+Z6IL9FAR03Dhf9 r2MDtEabiVJOaJuu9hYOG9XUYwxrXARMa6h4h6lJpJYCXw3SPUPZltfNB/8iI6bnQ+e0 HkaeO1DZOU4uJHYqg+2LGYlFKFPx4g+0pozW06mm6JmcECCkWTcy4toHAOp+o/rGf6hc CGfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795606; x=1744400406; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oH5zIz3fH+HzePqUrVUnHeTuTck/L6WwKXLj9XMwPLs=; b=q4TuzVAGjcEm0exUiupqejjn5EKC8ZUiC6ye+RxhGN2LCVo81SK7jV9fK6l2PQHtA3 eaCqXV25fjdvWPwXy9iu/65U5UhndoWeMiXGlHl8F2C5zQ26ZhPGJLrB+hL+YLPYOh88 HwXCdngYnQfraf2n1Xabo0IlKNxOKh8Te8WU9JKIAK4RNppe0x8UCu2loUw/xjtBgJ3R jb05LwPQxSGpPbNf0HJFgYieaT/wU/TdSRIp+M6/ICK98uTp82i/CgFcrU4bI+P96Jb+ u7sMvdXxTX357uHJGOZDfIhQjU/J4NBGJavhNOpU4lcvlxzC/pScEpw8HrTyCmH/YRAT juDg== X-Gm-Message-State: AOJu0YzZkMwAEzNE+3bOCt4dvGRgjFyTcnPYFKL29a/QrVujlfIQGdpI rv/1WJhIN7Be4/bHyi1GPhrzW8fjdnR7WaMiYY3GeWh1bGkb7z12IGpAY0wQkPE= X-Gm-Gg: ASbGnctc8EW31b6OVun6/Er81GDRZI/eYeBLOeh3emGkkrK0hGHUtBJHSUmqoRnB2og TQEXWNZeWNU6PLeCLgCYsgR7kNwr/UHO0CyhNkBfOkQmkJ7HumVecPQACDj8WevPPxnp+g3YBnt 2G1fA+Wm7k7uaph1we6kk6TZUqe3czFyd3Fp2LEOQxldv+EUY0doHwRbkiLHtxk0sXxFquKi7js wVNMbc+W3Pz835QueeGJ7+hNfwPOx9OwGQPq7Zlc/1Vt6lykxA9xSII05wRVTDhl+HPDfJfhCB9 HT4fSskjeFDYnYBsEmxvj1C11xiUG1RTef2h4axkFf90jd3fEKp9SU6BuK/n6ob4yk7/rhFW7wS 8qRFjv++ypX1eSpNGSXzfJk/Q X-Google-Smtp-Source: AGHT+IH5cc/FEexBUEnQan3JgIPEmzkBlB9vYHStRDWZ2IzvcyTnSSm/e/hbP9dk57e3uTYbZluCnw== X-Received: by 2002:a05:6102:91c:b0:4c1:801e:deb2 with SMTP id ada2fe7eead31-4c86365fe4emr787099137.7.1743795605972; Fri, 04 Apr 2025 12:40:05 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:04 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 02/11] test-bap: Introduce USR/SCC tests for LC3 Date: Fri, 4 Apr 2025 15:39:40 -0400 Message-ID: <20250404193959.359008-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz 4.9.1 Unicast Server as Audio Sink Performs Config Codec – LC3 Test Purpose: Verify that a Unicast Server Audio Sink IUT can perform a Config Codec operation initiated by a Unicast Client for an ASE in the Idle state, the Codec Configured state. Pass Veridict: The IUT sends a Response_Code of 0x00 (Success) in response to each Config Codec operation. 4.9.2 Unicast Server as Audio Source Performs Config Codec – LC3 Test Purpose: Verify that a Unicast Server Audio Source IUT can perform a Config Codec operation initiated by a Unicast Client for an ASE in the Idle state, the Codec Configured state. Pass verdict: The IUT sends a Response_Code of 0x00 (Success) in response to each Config Codec operation. Test Summary ------------ BAP/USR/SCC/BV-001-C [USR SNK Config Codec, LC3 8_1] Passed BAP/USR/SCC/BV-002-C [USR SNK Config Codec, LC3 8_2] Passed BAP/USR/SCC/BV-003-C [USR SNK Config Codec, LC3 16_1] Passed BAP/USR/SCC/BV-004-C [USR SNK Config Codec, LC3 16_2] Passed BAP/USR/SCC/BV-005-C [USR SNK Config Codec, LC3 24_1] Passed BAP/USR/SCC/BV-006-C [USR SNK Config Codec, LC3 24_2] Passed BAP/USR/SCC/BV-007-C [USR SNK Config Codec, LC3 32_1] Passed BAP/USR/SCC/BV-008-C [USR SNK Config Codec, LC3 32_2] Passed BAP/USR/SCC/BV-009-C [USR SNK Config Codec, LC3 44.1_1] Passed BAP/USR/SCC/BV-010-C [USR SNK Config Codec, LC3 44.1_2] Passed BAP/USR/SCC/BV-011-C [USR SNK Config Codec, LC3 48_1] Passed BAP/USR/SCC/BV-012-C [USR SNK Config Codec, LC3 48_2] Passed BAP/USR/SCC/BV-013-C [USR SNK Config Codec, LC3 48_3] Passed BAP/USR/SCC/BV-014-C [USR SNK Config Codec, LC3 48_4] Passed BAP/USR/SCC/BV-015-C [USR SNK Config Codec, LC3 48_5] Passed BAP/USR/SCC/BV-016-C [USR SNK Config Codec, LC3 48_6] Passed BAP/USR/SCC/BV-017-C [USR SRC Config Codec, LC3 8_1] Passed BAP/USR/SCC/BV-018-C [USR SRC Config Codec, LC3 8_2] Passed BAP/USR/SCC/BV-019-C [USR SRC Config Codec, LC3 16_1] Passed BAP/USR/SCC/BV-020-C [USR SRC Config Codec, LC3 16_2] Passed BAP/USR/SCC/BV-021-C [USR SRC Config Codec, LC3 24_1] Passed BAP/USR/SCC/BV-022-C [USR SRC Config Codec, LC3 24_2] Passed BAP/USR/SCC/BV-023-C [USR SRC Config Codec, LC3 32_1] Passed BAP/USR/SCC/BV-024-C [USR SRC Config Codec, LC3 32_2] Passed BAP/USR/SCC/BV-025-C [USR SRC Config Codec, LC3 44.1_1] Passed BAP/USR/SCC/BV-026-C [USR SRC Config Codec, LC3 44.1_2] Passed BAP/USR/SCC/BV-027-C [USR SRC Config Codec, LC3 48_1] Passed BAP/USR/SCC/BV-028-C [USR SRC Config Codec, LC3 48_2] Passed BAP/USR/SCC/BV-029-C [USR SRC Config Codec, LC3 48_3] Passed BAP/USR/SCC/BV-030-C [USR SRC Config Codec, LC3 48_4] Passed BAP/USR/SCC/BV-031-C [USR SRC Config Codec, LC3 48_5] Passed BAP/USR/SCC/BV-032-C [USR SRC Config Codec, LC3 48_6] Passed Total: 32, Passed: 32 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 234 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 202 insertions(+), 32 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index cabb9b296ee2..dc199f4871e1 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -90,9 +90,11 @@ static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY, 3u, 26, 240); static struct bt_bap_pac_qos lc3_qos = { + .phy = 0x02, + .rtn = 0x01, .location = 0x00000003, .supported_context = 0x0fff, - .context = 0x0fff + .context = 0x0fff, }; #define iov_data(args...) ((const struct iovec[]) { args }) @@ -402,12 +404,18 @@ static void gatt_notify_cb(struct gatt_db_attribute *attrib, struct test_data *data = user_data; uint16_t handle = gatt_db_attribute_get_handle(attrib); - if (!data->server) + if (tester_use_debug()) + tester_debug("handle 0x%04x len %zd", handle, len); + + if (!data->server) { + if (tester_use_debug()) + tester_debug("data->server %p", data->server); return; + } if (!bt_gatt_server_send_notification(data->server, handle, value, len, false)) - printf("%s: Failed to send notification\n", __func__); + tester_debug("%s: Failed to send notification", __func__); } static void gatt_ccc_read_cb(struct gatt_db_attribute *attrib, @@ -475,6 +483,19 @@ static void setup_complete_cb(const void *user_data) tester_setup_complete(); } +static int pac_config(struct bt_bap_stream *stream, struct iovec *cfg, + struct bt_bap_qos *qos, bt_bap_pac_config_t cb, + void *user_data) +{ + cb(stream, 0); + + return 0; +} + +static struct bt_bap_pac_ops ucast_pac_ops = { + .config = pac_config, +}; + static void test_setup_server(const void *user_data) { struct test_data *data = (void *)user_data; @@ -494,23 +515,19 @@ static void test_setup_server(const void *user_data) data->ccc_states = queue_new(); - /* If there is no configuration, add a sink PAC since otherwise bt_bap - * won't even register the required services. - */ - if (!data->cfg) { - data->snk = bt_bap_add_pac(db, "test-bap-snk", - BT_BAP_SINK, LC3_ID, + data->snk = bt_bap_add_pac(db, "test-bap-snk", BT_BAP_SINK, LC3_ID, data->qos, data->caps, NULL); - data->src = bt_bap_add_pac(db, "test-bap-src", - BT_BAP_SOURCE, LC3_ID, + g_assert(data->snk); + + bt_bap_pac_set_ops(data->snk, &ucast_pac_ops, NULL); + + data->src = bt_bap_add_pac(db, "test-bap-src", BT_BAP_SOURCE, LC3_ID, data->qos, data->caps, NULL); - g_assert(data->snk); - g_assert(data->src); - } else { - test_setup_pacs(data); - } + g_assert(data->src); + + bt_bap_pac_set_ops(data->src, &ucast_pac_ops, NULL); att = bt_att_new(io_get_fd(io), false); g_assert(att); @@ -675,15 +692,6 @@ static void test_client(const void *user_data) bt_bap_attach(data->bap, data->client); } -static int pac_config(struct bt_bap_stream *stream, struct iovec *cfg, - struct bt_bap_qos *qos, bt_bap_pac_config_t cb, - void *user_data) -{ - cb(stream, 0); - - return 0; -} - static struct bt_bap_pac_ops bcast_pac_ops = { .config = pac_config, }; @@ -1154,8 +1162,6 @@ static void test_server(const void *user_data) tester_io_set_complete_func(test_complete_cb); - test_setup_pacs(data); - data->id = bt_bap_register(bap_attached, NULL, data); g_assert(data->id); @@ -1221,13 +1227,13 @@ static void test_disc(void) * Data: 0101010000 * ATT: Handle Value Notification (0x1b) len 37 * Handle: 0x0016 - * Data: 01010102010a00204e00409c00204e00409c00_cfg + * Data: 01010002010a00204e00409c00204e00409c00_cfg */ #define SCC_SNK(_cfg...) \ IOV_DATA(0x52, 0x22, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, _cfg), \ IOV_DATA(0x1b, 0x22, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00), \ IOV_NULL, \ - IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x0a, 0x00, \ + IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x01, 0x00, 0x02, 0x01, 0x0a, 0x00, \ 0x20, 0x4e, 0x00, 0x40, 0x9c, 0x00, 0x20, 0x4e, 0x00, \ 0x40, 0x9c, 0x00, _cfg) @@ -1412,13 +1418,13 @@ static struct test_config cfg_snk_48_6 = { * Data: 0101030000 * ATT: Handle Value Notification (0x1b) len 37 * Handle: 0x001c - * Data: 03010102010a00204e00409c00204e00409c00_cfg + * Data: 03010002010a00204e00409c00204e00409c00_cfg */ #define SCC_SRC(_cfg...) \ IOV_DATA(0x52, 0x22, 0x00, 0x01, 0x01, 0x03, 0x02, 0x02, _cfg), \ IOV_DATA(0x1b, 0x22, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00), \ IOV_NULL, \ - IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x01, 0x01, 0x02, 0x01, 0x0a, 0x00, \ + IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x01, 0x00, 0x02, 0x01, 0x0a, 0x00, \ 0x20, 0x4e, 0x00, 0x40, 0x9c, 0x00, 0x20, 0x4e, 0x00, \ 0x40, 0x9c, 0x00, _cfg) @@ -1600,7 +1606,7 @@ static struct test_config cfg_src_48_6 = { * formatted in an LTV structure with the length, type, and value * specified in Table 4.10. */ -static void test_scc_cc_lc3(void) +static void test_ucl_scc_cc_lc3(void) { define_test("BAP/UCL/SCC/BV-001-C [UCL SRC Config Codec, LC3 8_1]", test_setup, test_client, &cfg_snk_8_1, SCC_SNK_8_1); @@ -1668,6 +1674,170 @@ static void test_scc_cc_lc3(void) test_setup, test_client, &cfg_src_48_6, SCC_SRC_48_6); } + +/* 4.9 Unicast Server Configuration */ +static void test_usr_scc_cc_lc3(void) +{ + /* 4.9.1 Unicast Server as Audio Sink Performs Config Codec – LC3 + * + * Test Purpose: + * Verify that a Unicast Server Audio Sink IUT can perform a Config + * Codec operation initiated by a Unicast Client for an ASE in the Idle + * state, the Codec Configured state. + * + * Pass Veridict: + * The IUT sends a Response_Code of 0x00 (Success) in response to each + * Config Codec operation. + * + * BAP/USR/SCC/BV-001-C [USR SNK Config Codec, LC3 8_1] + * BAP/USR/SCC/BV-002-C [USR SNK Config Codec, LC3 8_2] + * BAP/USR/SCC/BV-003-C [USR SNK Config Codec, LC3 16_1] + * BAP/USR/SCC/BV-004-C [USR SNK Config Codec, LC3 16_2] + * BAP/USR/SCC/BV-005-C [USR SNK Config Codec, LC3 24_1] + * BAP/USR/SCC/BV-006-C [USR SNK Config Codec, LC3 24_2] + * BAP/USR/SCC/BV-007-C [USR SNK Config Codec, LC3 32_1] + * BAP/USR/SCC/BV-008-C [USR SNK Config Codec, LC3 32_2] + * BAP/USR/SCC/BV-009-C [USR SNK Config Codec, LC3 44.1_1] + * BAP/USR/SCC/BV-010-C [USR SNK Config Codec, LC3 44.1_2] + * BAP/USR/SCC/BV-011-C [USR SNK Config Codec, LC3 48_1] + * BAP/USR/SCC/BV-012-C [USR SNK Config Codec, LC3 48_2] + * BAP/USR/SCC/BV-013-C [USR SNK Config Codec, LC3 48_3] + * BAP/USR/SCC/BV-014-C [USR SNK Config Codec, LC3 48_4] + * BAP/USR/SCC/BV-015-C [USR SNK Config Codec, LC3 48_5] + * BAP/USR/SCC/BV-016-C [USR SNK Config Codec, LC3 48_6] + */ + define_test("BAP/USR/SCC/BV-001-C [USR SNK Config Codec, LC3 8_1]", + test_setup_server, test_server, &cfg_snk_8_1, + SCC_SNK_8_1); + define_test("BAP/USR/SCC/BV-002-C [USR SNK Config Codec, LC3 8_2]", + test_setup_server, test_server, &cfg_snk_8_2, + SCC_SNK_8_2); + define_test("BAP/USR/SCC/BV-003-C [USR SNK Config Codec, LC3 16_1]", + test_setup_server, test_server, &cfg_snk_16_1, + SCC_SNK_16_1); + define_test("BAP/USR/SCC/BV-004-C [USR SNK Config Codec, LC3 16_2]", + test_setup_server, test_server, &cfg_snk_16_2, + SCC_SNK_16_2); + define_test("BAP/USR/SCC/BV-005-C [USR SNK Config Codec, LC3 24_1]", + test_setup_server, test_server, &cfg_snk_24_1, + SCC_SNK_24_1); + define_test("BAP/USR/SCC/BV-006-C [USR SNK Config Codec, LC3 24_2]", + test_setup_server, test_server, &cfg_snk_24_2, + SCC_SNK_24_2); + define_test("BAP/USR/SCC/BV-007-C [USR SNK Config Codec, LC3 32_1]", + test_setup_server, test_server, &cfg_snk_32_1, + SCC_SNK_32_1); + define_test("BAP/USR/SCC/BV-008-C [USR SNK Config Codec, LC3 32_2]", + test_setup_server, test_server, &cfg_snk_32_2, + SCC_SNK_32_2); + define_test("BAP/USR/SCC/BV-009-C [USR SNK Config Codec, LC3 44.1_1]", + test_setup_server, test_server, &cfg_snk_44_1, + SCC_SNK_44_1); + define_test("BAP/USR/SCC/BV-010-C [USR SNK Config Codec, LC3 44.1_2]", + test_setup_server, test_server, &cfg_snk_44_2, + SCC_SNK_44_2); + define_test("BAP/USR/SCC/BV-011-C [USR SNK Config Codec, LC3 48_1]", + test_setup_server, test_server, &cfg_snk_48_1, + SCC_SNK_48_1); + define_test("BAP/USR/SCC/BV-012-C [USR SNK Config Codec, LC3 48_2]", + test_setup_server, test_server, &cfg_snk_48_2, + SCC_SNK_48_2); + define_test("BAP/USR/SCC/BV-013-C [USR SNK Config Codec, LC3 48_3]", + test_setup_server, test_server, &cfg_snk_48_3, + SCC_SNK_48_3); + define_test("BAP/USR/SCC/BV-014-C [USR SNK Config Codec, LC3 48_4]", + test_setup_server, test_server, &cfg_snk_48_4, + SCC_SNK_48_4); + define_test("BAP/USR/SCC/BV-015-C [USR SNK Config Codec, LC3 48_5]", + test_setup_server, test_server, &cfg_snk_48_5, + SCC_SNK_48_5); + define_test("BAP/USR/SCC/BV-016-C [USR SNK Config Codec, LC3 48_6]", + test_setup_server, test_server, &cfg_snk_48_6, + SCC_SNK_48_6); + /* 4.9.2 Unicast Server as Audio Source Performs Config Codec – LC3 + * + * Test Purpose + * Verify that a Unicast Server Audio Source IUT can perform a Config + * Codec operation initiated by a Unicast Client for an ASE in the Idle + * state, the Codec Configured state. + * + * Pass verdict + * The IUT sends a Response_Code of 0x00 (Success) in response to each + * Config Codec operation. + * + * BAP/USR/SCC/BV-017-C [USR SRC Config Codec, LC3 8_1] + * BAP/USR/SCC/BV-018-C [USR SRC Config Codec, LC3 8_2] + * BAP/USR/SCC/BV-019-C [USR SRC Config Codec, LC3 16_1] + * BAP/USR/SCC/BV-020-C [USR SRC Config Codec, LC3 16_2] + * BAP/USR/SCC/BV-021-C [USR SRC Config Codec, LC3 24_1] + * BAP/USR/SCC/BV-022-C [USR SRC Config Codec, LC3 24_2] + * BAP/USR/SCC/BV-023-C [USR SRC Config Codec, LC3 32_1] + * BAP/USR/SCC/BV-024-C [USR SRC Config Codec, LC3 32_2] + * BAP/USR/SCC/BV-025-C [USR SRC Config Codec, LC3 44.1_1] + * BAP/USR/SCC/BV-026-C [USR SRC Config Codec, LC3 44.1_2] + * BAP/USR/SCC/BV-027-C [USR SRC Config Codec, LC3 48_1] + * BAP/USR/SCC/BV-028-C [USR SRC Config Codec, LC3 48_2] + * BAP/USR/SCC/BV-029-C [USR SRC Config Codec, LC3 48_3] + * BAP/USR/SCC/BV-030-C [USR SRC Config Codec, LC3 48_4] + * BAP/USR/SCC/BV-031-C [USR SRC Config Codec, LC3 48_5] + * BAP/USR/SCC/BV-032-C [USR SRC Config Codec, LC3 48_6] + */ + define_test("BAP/USR/SCC/BV-017-C [USR SRC Config Codec, LC3 8_1]", + test_setup_server, test_server, &cfg_src_8_1, + SCC_SRC_8_1); + define_test("BAP/USR/SCC/BV-018-C [USR SRC Config Codec, LC3 8_2]", + test_setup_server, test_server, &cfg_src_8_2, + SCC_SRC_8_2); + define_test("BAP/USR/SCC/BV-019-C [USR SRC Config Codec, LC3 16_1]", + test_setup_server, test_server, &cfg_src_16_1, + SCC_SRC_16_1); + define_test("BAP/USR/SCC/BV-020-C [USR SRC Config Codec, LC3 16_2]", + test_setup_server, test_server, &cfg_src_16_2, + SCC_SRC_16_2); + define_test("BAP/USR/SCC/BV-021-C [USR SRC Config Codec, LC3 24_1]", + test_setup_server, test_server, &cfg_src_24_1, + SCC_SRC_24_1); + define_test("BAP/USR/SCC/BV-022-C [USR SRC Config Codec, LC3 24_2]", + test_setup_server, test_server, &cfg_src_24_2, + SCC_SRC_24_2); + define_test("BAP/USR/SCC/BV-023-C [USR SRC Config Codec, LC3 32_1]", + test_setup_server, test_server, &cfg_src_32_1, + SCC_SRC_32_1); + define_test("BAP/USR/SCC/BV-024-C [USR SRC Config Codec, LC3 32_2]", + test_setup_server, test_server, &cfg_src_32_2, + SCC_SRC_32_2); + define_test("BAP/USR/SCC/BV-025-C [USR SRC Config Codec, LC3 44.1_1]", + test_setup_server, test_server, &cfg_src_44_1, + SCC_SRC_44_1); + define_test("BAP/USR/SCC/BV-026-C [USR SRC Config Codec, LC3 44.1_2]", + test_setup_server, test_server, &cfg_src_44_2, + SCC_SRC_44_2); + define_test("BAP/USR/SCC/BV-027-C [USR SRC Config Codec, LC3 48_1]", + test_setup_server, test_server, &cfg_src_48_1, + SCC_SRC_48_1); + define_test("BAP/USR/SCC/BV-028-C [USR SRC Config Codec, LC3 48_2]", + test_setup_server, test_server, &cfg_src_48_2, + SCC_SRC_48_2); + define_test("BAP/USR/SCC/BV-029-C [USR SRC Config Codec, LC3 48_3]", + test_setup_server, test_server, &cfg_src_48_3, + SCC_SRC_48_3); + define_test("BAP/USR/SCC/BV-030-C [USR SRC Config Codec, LC3 48_4]", + test_setup_server, test_server, &cfg_src_48_4, + SCC_SRC_48_4); + define_test("BAP/USR/SCC/BV-031-C [USR SRC Config Codec, LC3 48_5]", + test_setup_server, test_server, &cfg_src_48_5, + SCC_SRC_48_5); + define_test("BAP/USR/SCC/BV-032-C [USR SRC Config Codec, LC3 48_6]", + test_setup_server, test_server, &cfg_src_48_6, + SCC_SRC_48_6); +} + +static void test_scc_cc_lc3(void) +{ + test_ucl_scc_cc_lc3(); + test_usr_scc_cc_lc3(); +} + static struct test_config cfg_snk_vs = { .cc = IOV_NULL, .qos = QOS_UCAST, From patchwork Fri Apr 4 19:39:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878288 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5285224232 for ; Fri, 4 Apr 2025 19:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795612; cv=none; b=mEBQu1T2IdBJR+UEjca2sqP9vhjQ+yTtNHN/eS6k7D8L2sdxPqTfx8z4Rwct5Ah+p7NcF1IwVfeeEnO2os3+EZFAfkfy1zw7JRXXBDN+1AnOgK2a+wqZn3JGuti/nXmShljKGLGKjy/9Lv+/wfYBceTTzRuC0xu8H4OZ9pgJkgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795612; c=relaxed/simple; bh=KQ6zjReTABiBm3jtq26ekRlm8NKBE4mxeC93WXb6TPw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fa+HlWYMsoEB7pwcCeHeglbLMENYNHfm2wOOjsS3t/dm5jZU0n29amtzunURzblrAjnm7btRjkdUSOzpquRfiK29NQelokV+KoH4q9pyc1S018VnF/pIbOAcM+S5RM4HPvwshLj3WIH+OSv3PBjYCRAZipQvwALYCEj9amGVQGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mxOYAnT2; arc=none smtp.client-ip=209.85.222.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mxOYAnT2" Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-86715793b1fso1084843241.0 for ; Fri, 04 Apr 2025 12:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795608; x=1744400408; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PnW6bQ2pyqKtX+lZBOs0Rlk2R9hc1cl6F5/z4bS5Tbw=; b=mxOYAnT2GD2PWbwpvq8cdpg9D0osLksfXv07n+AN3ltBICm4DUFIqxk29JbEHRrQYy if/L0jl3bsGFc5Zxf9WoD+vqqifrg02UdwXVo12nY1HMAcVqDysuBQENlZ6HOg3RsNDD 5N5m9wrKp11X6MuUypL6mQTByd9x6GUop++IdTM+WhaGg8IOmJvcjz/QH4nhldsVaQfx ouKDXVpYgjUgB0YFKTFeXal5IQ/LMPsUUHqL370L8dHGTWsSIA/ldEMPF2H120wQoHag MfLj+1w+lwYFHJaTqTTkwokfo5eO7h8V5CeVDPhPuE37X4vfnF8tq5iRVftu/uwUY64F R1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795608; x=1744400408; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PnW6bQ2pyqKtX+lZBOs0Rlk2R9hc1cl6F5/z4bS5Tbw=; b=DMYOiY3ZDDHq8c6v1SLkM+NZC5BUSg5fCfAgX4KPeHQnjXMwBA5QN5ET3Fo03f0BQ+ S+vupL4rQ2bcbTwB1FoD1aTg6AMtEFjup8JQ3GbGbZPHvomgKX81WXNMbtLpm1Jgo5mv B8/pGV5lHR1G0LjQE4BwS9Y364cSonsKXws3RK9jVZ9SOdszbuqmbwyYuETk/YNBRGiA ffWjV2q5cJJZjfzIR+OHUv/RsZJdkXw6z1NdJt8VsiIaCDyd39FlTug3Nxm897SDiu3u AX+AqZfeR19gwyl8tfHVmlnFU9YPu/batEuWoMQbkYPi8nY8Arw2JTKRwHv6OK26Lp+W WKyA== X-Gm-Message-State: AOJu0YwtleP3d7XZB2vOn1T9Jmt+EAke1+ODb8+bhPXFiLLM67MLyrax wpzgKSJ7divcN+afpkFalZsK02c9C2tBX5/ncEcwbGYsKhILFsPAJ/W7wO/07d0= X-Gm-Gg: ASbGncuB8BOz4788v+z+yfdjpaxmumvQpU14kPhciTj4KH5nRj5z3/PzmNmsqk+Eze6 EeMnFuzReiiHt2W/U+oq0cnUVu8sgFdvB3Up31QAyuMr3HfkRwAHwjsFWJ6e8JWigSHNGJxoS2N cSYBCSmxAxJlmihsr144WXJGnij458bXe7TMpu44R8w2rGrshrFxTHVhKfc+SplUKUXc/JcQTUs FDZEWItgw9h0bwz8q0eAKXM1B7rSS+Hp11SLZXv7FVsr7/+yttm2jzOBHOWSbMwoVOnSGg1fv8+ OiT05RP55FH2oqSb6eJ4c5XBmkC31l23g+gm5J9Cgc95MYJeKaIvgVwlOJH0wDcKPYMaWlni4r7 YRKHlXUD5olGyuw== X-Google-Smtp-Source: AGHT+IHoCH//hILwWK57HucwFh1+KkvCyPNNln3iQD7pTRRybUSC2nWKIrpv3XeA7m9OwGjnfz2RkQ== X-Received: by 2002:a05:6102:5787:b0:4c1:93df:e838 with SMTP id ada2fe7eead31-4c8554b41a4mr4836550137.23.1743795608131; Fri, 04 Apr 2025 12:40:08 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:06 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 03/11] test-bap: Introduce USR/SCC - VS tests for LC3 Date: Fri, 4 Apr 2025 15:39:41 -0400 Message-ID: <20250404193959.359008-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz BAP/USR/SCC/BV-033-C [USR SNK Config Codec, VS] Test Purpose: Verify that a Unicast Server Audio Sink IUT can perform a Config Codec operation initiated by a Unicast Client for a vendor-specific codec for an ASE in the Idle state, the Codec Configured state, and the QoS Configured state. Pass verdict: The IUT sends a notification of the ASE Control Point characteristic with the Response_Code field set to 0x00 (Success) for the requested ASE_ID and opcode. Test Summary ------------ BAP/USR/SCC/BV-033-C [USR SNK Config Codec, VS] Passed BAP/USR/SCC/BV-034-C [USR SRC Config Codec, VS] Passed Total: 2, Passed: 2 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 69 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index dc199f4871e1..470f59d387e5 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -515,16 +515,30 @@ static void test_setup_server(const void *user_data) data->ccc_states = queue_new(); - data->snk = bt_bap_add_pac(db, "test-bap-snk", BT_BAP_SINK, LC3_ID, - data->qos, data->caps, + if (data->cfg && data->cfg->vs) + data->snk = bt_bap_add_vendor_pac(db, "test-bap-snk", + BT_BAP_SINK, 0x0ff, + 0x0001, 0x0001, + data->qos, NULL, NULL); + else + data->snk = bt_bap_add_pac(db, "test-bap-snk", BT_BAP_SINK, + LC3_ID, data->qos, + data->caps, NULL); g_assert(data->snk); bt_bap_pac_set_ops(data->snk, &ucast_pac_ops, NULL); - data->src = bt_bap_add_pac(db, "test-bap-src", BT_BAP_SOURCE, LC3_ID, - data->qos, data->caps, + if (data->cfg && data->cfg->vs) + data->src = bt_bap_add_vendor_pac(db, "test-bap-snk", + BT_BAP_SOURCE, 0x0ff, + 0x0001, 0x0001, + data->qos, NULL, NULL); + else + data->src = bt_bap_add_pac(db, "test-bap-src", BT_BAP_SOURCE, + LC3_ID, data->qos, + data->caps, NULL); g_assert(data->src); bt_bap_pac_set_ops(data->src, &ucast_pac_ops, NULL); @@ -1756,12 +1770,12 @@ static void test_usr_scc_cc_lc3(void) SCC_SNK_48_6); /* 4.9.2 Unicast Server as Audio Source Performs Config Codec – LC3 * - * Test Purpose + * Test Purpose: * Verify that a Unicast Server Audio Source IUT can perform a Config * Codec operation initiated by a Unicast Client for an ASE in the Idle * state, the Codec Configured state. * - * Pass verdict + * Pass verdict: * The IUT sends a Response_Code of 0x00 (Success) in response to each * Config Codec operation. * @@ -1873,7 +1887,7 @@ static struct test_config cfg_src_vs = { * parameter is formatted with octet 0 set to 0xFF, octets 1–2 set to * TSPX_VS_Company_ID, and octets 3–4 set to TSPX_VS_Codec_ID. */ -static void test_scc_cc_vs(void) +static void test_ucl_scc_cc_vs(void) { define_test("BAP/UCL/SCC/BV-033-C [UCL SRC Config Codec, VS]", test_setup, test_client, &cfg_snk_vs, SCC_SNK_VS); @@ -1881,6 +1895,47 @@ static void test_scc_cc_vs(void) test_setup, test_client, &cfg_src_vs, SCC_SRC_VS); } +static void test_usr_scc_cc_vs(void) +{ + /* BAP/USR/SCC/BV-033-C [USR SNK Config Codec, VS] + * + * Test Purpose: + * Verify that a Unicast Server Audio Sink IUT can perform a Config + * Codec operation initiated by a Unicast Client for a vendor-specific + * codec for an ASE in the Idle state, the Codec Configured state, and + * the QoS Configured state. + * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic + * with the Response_Code field set to 0x00 (Success) for the requested + * ASE_ID and opcode. + */ + define_test("BAP/USR/SCC/BV-033-C [USR SNK Config Codec, VS]", + test_setup_server, test_server, &cfg_snk_vs, + SCC_SNK_VS); + /* BAP/USR/SCC/BV-034-C [USR SRC Config Codec, VS] + * + * Test Purpose: + * Verify that a Unicast Server Audio Source IUT can perform a Config + * Codec operation initiated by a Unicast Client for a vendor-specific + * codec for a Source ASE in the Idle state. + * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic + * with the Response_Code field set to 0x00 (Success) for the requested + * ASE_ID and opcode. + */ + define_test("BAP/USR/SCC/BV-034-C [USR SRC Config Codec, VS]", + test_setup_server, test_server, &cfg_src_vs, + SCC_SRC_VS); +} + +static void test_scc_cc_vs(void) +{ + test_ucl_scc_cc_vs(); + test_usr_scc_cc_vs(); +} + static struct test_config cfg_snk_8_1_1 = { .cc = LC3_CONFIG_8_1, .qos = LC3_QOS_8_1_1, From patchwork Fri Apr 4 19:39:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878640 Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 290BB2248AA for ; Fri, 4 Apr 2025 19:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795614; cv=none; b=LjHQYA6Jjxyk9obvK1UQ6swjN9RFpTpSuquUcTqL9HVVInEZGgr8XGe0D6cZoU3/d6qw6vOKzUFbTpkWf32NpiY1YZk37FEa/h3qS3w3xZtsspIl4aeXkUs4sL5a98p/0LYzrIuz8eQ+dn0es2KaLxwuYGNWqQ+YUYz8CsZm0Z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795614; c=relaxed/simple; bh=MgGuLFJ2DjfVF7ek98JsWFIEL2sH9WB3iOfFHAUb3Oc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=X4Ch5U8BFnvxwzdBjbyVc2Hvqn+g4Qp2evgILxSdKoBCk/RbEUCz2OhQEq53o2kEf31ppDILRT2ZDGurb7uZUYtAEjYqlmV1zdm8P3tDcFIC6aSQz8B6Fg/HpFKLZZBdEaNmReEc/qfTKxlHhosDp4FyACBzuX0M7OMij4qyKzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aKweWxT9; arc=none smtp.client-ip=209.85.221.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aKweWxT9" Received: by mail-vk1-f172.google.com with SMTP id 71dfb90a1353d-5259327a93bso1128051e0c.2 for ; Fri, 04 Apr 2025 12:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795610; x=1744400410; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=gA3QOuG3Dd4SRx2ENqGs0NC8RCaJrlEWYszAo+sPZBU=; b=aKweWxT9ZnbHoy/luSlJcaJKdjWTcRYhVH1AZyV+VsktJotJ2u7woIjaC46wAhI2gP R+PycMqUS/9ew1JIIdPkBq63s2aBxQIrIF/k1Hl/nbbEozeQ0UvGh8NFMNTWrB1NDT3q jRbtZgPkJLuLbA4J0yjudRY7qNisDdvtWJc8ABeqk5J2KWup1CK0zLbHzzThESx+bDCv 8EZsBvLIEF7lAx9YS4T2gqAyCWA9QJXej8OL6vWqF7Ka1f+zOxax9oLvsIvvQXo9jd3X OeRRxCNeofAwT1F/lYAzRIEub6XSyc51J41cW3QEx1JkWgw72qt7sBk7yeb2vp8aAbGb B2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795610; x=1744400410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gA3QOuG3Dd4SRx2ENqGs0NC8RCaJrlEWYszAo+sPZBU=; b=okmztehc7FfpuuFN+6zTvnzO6ApJpt6XbdrifGoNFw08izfzY6DmFd04uy0bG73L/J jROcz4I7wtC2q0tmJlI9lfi4LfhjC9e/WkHMr99DcMjXj5m99Wze3GrdRFVVrri+pH/d mKP0MYjKpJ5nU7PcSJvi5cYw3mNbLGahXEz8JeprYx/GlQJ+C5f1GyqtQHBjVCDLEqsP XNPhaOSLffwBjwo0G5whXYFsTwVbAFAqYRzPZ9aepXB0X0/k94QuFK4aur4eO4clF10w I/I5h1p2/qimVw+5CFXqhykbdJduPqLi+bVfXUmVSV8rDLVYclQr1Wlk7Mxkrr13tZKv KVuQ== X-Gm-Message-State: AOJu0YzEYffpXf4RxrHApWrtqVx0LcP4BMC8kIdFEyh8vh/5kKnRzGlI zsci7FXCcNOQTdTNhi5vk1SXso7QvgOUVokbcMKS1CrbNNyL31VUWF8AbLDn3X0= X-Gm-Gg: ASbGncsqLYWjYE7KfXN5lapy+u3j1YGwTcPyre2C1/G3mq4EOu39I08tCqZW1hjPaWp 7S5sMOCdAqY2A0Sz6HsSfIA19CFa9/++VbLj1pw/RNgWS0VWILrsDiSDqraAtvWyhZLb7vQpwmH Smtk0aQulvm6UJ2dbU7ybsShA4vdYd4NXQyWs6UK2Qz6ePCase4B3J2ekhTD0vp6fjdMCJH6BfM lcwJZKCYghtBKcmfeL9kPto3f/3RJx6/diAQKfjHZgRS9S2/SeLoDXM9AIvcFME5Ic7FcNXPMpK 7TAgeJhNICwyHj87bfeQet195+iPhwbGEiaIMuS15lXD3w0M3RC1/t5yJ+JF6aNKRHRcLja4bS3 o3J0BABgyJTJ3Iw== X-Google-Smtp-Source: AGHT+IFEE/SWkLOXVMRXytRdOKy0+DRX+VuW91AU0A/Ps0w5A5WPVC09NFu5n5xguG8a1VvjWFnK3A== X-Received: by 2002:a05:6102:5043:b0:4af:fca2:1b7 with SMTP id ada2fe7eead31-4c8568f0040mr3559408137.14.1743795609904; Fri, 04 Apr 2025 12:40:09 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:08 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 04/11] test-bap: Introduce USR/SCC QoS tests for LC3 Date: Fri, 4 Apr 2025 15:39:42 -0400 Message-ID: <20250404193959.359008-5-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Unicast Server Performs Config QoS – LC3 Test Purpose: Verify that a Unicast Server IUT can perform a Config QoS operation initiated by a Unicast Client for the LC3 codec. Pass verdict: In step 2, the IUT sends a notification of the ASE Control Point characteristic with Response_Code set to Success (0x00) for the requested ASE_ID and opcode. In step 3, the notified ASE characteristic value is correctly formatted, has the ASE_ID field set to Test_ASE_ID, the ASE_State field set to 0x02 (QoS Configured), and the Additional_ASE_Parameters field containing the CIG_ID, CIS_ID, and QoS configuration values requested in step 2. Test Summary ------------ BAP/USR/SCC/BV-069-C [USR SNK Config QoS, LC3 8_1_1] Passed BAP/USR/SCC/BV-070-C [USR SNK Config QoS, LC3 8_2_1] Passed BAP/USR/SCC/BV-071-C [USR SNK Config QoS, LC3 16_1_1] Passed BAP/USR/SCC/BV-072-C [USR SNK Config QoS, LC3 16_2_1] Passed BAP/USR/SCC/BV-073-C [USR SNK Config QoS, LC3 24_1_1] Passed BAP/USR/SCC/BV-074-C [USR SNK Config QoS, LC3 24_2_1] Passed BAP/USR/SCC/BV-075-C [USR SNK Config QoS, LC3 32_1_1] Passed BAP/USR/SCC/BV-076-C [USR SNK Config QoS, LC3 32_2_1] Passed BAP/USR/SCC/BV-077-C [USR SNK Config QoS, LC3 44.1_1_1] Passed BAP/USR/SCC/BV-078-C [USR SNK Config QoS, LC3 44.1_2_1] Passed BAP/USR/SCC/BV-079-C [USR SNK Config QoS, LC3 48_1_1] Passed BAP/USR/SCC/BV-080-C [USR SNK Config QoS, LC3 48_2_1] Passed BAP/USR/SCC/BV-081-C [USR SNK Config QoS, LC3 48_3_1] Passed BAP/USR/SCC/BV-082-C [USR SNK Config QoS, LC3 48_4_1] Passed BAP/USR/SCC/BV-083-C [USR SNK Config QoS, LC3 48_5_1] Passed BAP/USR/SCC/BV-084-C [USR SNK Config QoS, LC3 48_6_1] Passed BAP/USR/SCC/BV-085-C [USR SRC Config QoS, LC3 8_1_1] Passed BAP/USR/SCC/BV-086-C [USR SRC Config QoS, LC3 8_2_1] Passed BAP/USR/SCC/BV-087-C [USR SRC Config QoS, LC3 16_1_1] Passed BAP/USR/SCC/BV-088-C [USR SRC Config QoS, LC3 16_2_1] Passed BAP/USR/SCC/BV-089-C [USR SRC Config QoS, LC3 24_1_1] Passed BAP/USR/SCC/BV-090-C [USR SRC Config QoS, LC3 24_2_1] Passed BAP/USR/SCC/BV-091-C [USR SRC Config QoS, LC3 32_1_1] Passed BAP/USR/SCC/BV-092-C [USR SRC Config QoS, LC3 32_2_1] Passed BAP/USR/SCC/BV-093-C [USR SRC Config QoS, LC3 44.1_1_1] Passed BAP/USR/SCC/BV-094-C [USR SRC Config QoS, LC3 44.1_2_1] Passed BAP/USR/SCC/BV-095-C [USR SRC Config QoS, LC3 48_1_1] Passed BAP/USR/SCC/BV-096-C [USR SRC Config QoS, LC3 48_2_1] Passed BAP/USR/SCC/BV-097-C [USR SRC Config QoS, LC3 48_3_1] Passed BAP/USR/SCC/BV-098-C [USR SRC Config QoS, LC3 48_4_1] Passed BAP/USR/SCC/BV-099-C [USR SRC Config QoS, LC3 48_5_1] Passed BAP/USR/SCC/BV-100-C [USR SRC Config QoS, LC3 48_6_1] Passed BAP/USR/SCC/BV-101-C [USR SNK Config QoS, LC3 8_1_2] Passed BAP/USR/SCC/BV-102-C [USR SNK Config QoS, LC3 8_2_2] Passed BAP/USR/SCC/BV-103-C [USR SNK Config QoS, LC3 16_1_2] Passed BAP/USR/SCC/BV-104-C [USR SNK Config QoS, LC3 16_2_2] Passed BAP/USR/SCC/BV-105-C [USR SNK Config QoS, LC3 24_1_2] Passed BAP/USR/SCC/BV-106-C [USR SNK Config QoS, LC3 24_2_2] Passed BAP/USR/SCC/BV-107-C [USR SNK Config QoS, LC3 32_1_2] Passed BAP/USR/SCC/BV-108-C [USR SNK Config QoS, LC3 32_2_2] Passed BAP/USR/SCC/BV-109-C [USR SNK Config QoS, LC3 44.1_1_2] Passed BAP/USR/SCC/BV-110-C [USR SNK Config QoS, LC3 44.1_2_2] Passed BAP/USR/SCC/BV-111-C [USR SNK Config QoS, LC3 48_1_2] Passed BAP/USR/SCC/BV-112-C [USR SNK Config QoS, LC3 48_2_2] Passed BAP/USR/SCC/BV-113-C [USR SNK Config QoS, LC3 48_3_2] Passed BAP/USR/SCC/BV-114-C [USR SNK Config QoS, LC3 48_4_2] Passed BAP/USR/SCC/BV-115-C [USR SNK Config QoS, LC3 48_5_2] Passed BAP/USR/SCC/BV-116-C [USR SNK Config QoS, LC3 48_6_2] Passed BAP/USR/SCC/BV-117-C [USR SRC Config QoS, LC3 8_1_2] Passed BAP/USR/SCC/BV-118-C [USR SRC Config QoS, LC3 8_2_2] Passed BAP/USR/SCC/BV-119-C [USR SRC Config QoS, LC3 16_1_2] Passed BAP/USR/SCC/BV-120-C [USR SRC Config QoS, LC3 16_2_2] Passed BAP/USR/SCC/BV-121-C [USR SRC Config QoS, LC3 24_1_2] Passed BAP/USR/SCC/BV-122-C [USR SRC Config QoS, LC3 24_2_2] Passed BAP/USR/SCC/BV-123-C [USR SRC Config QoS, LC3 32_1_2] Passed BAP/USR/SCC/BV-124-C [USR SRC Config QoS, LC3 32_2_2] Passed BAP/USR/SCC/BV-125-C [USR SRC Config QoS, LC3 44.1_1_2] Passed BAP/USR/SCC/BV-126-C [USR SRC Config QoS, LC3 44.1_2_2] Passed BAP/USR/SCC/BV-127-C [USR SRC Config QoS, LC3 48_1_2] Passed BAP/USR/SCC/BV-128-C [USR SRC Config QoS, LC3 48_2_2] Passed BAP/USR/SCC/BV-129-C [USR SRC Config QoS, LC3 48_3_2] Passed BAP/USR/SCC/BV-130-C [USR SRC Config QoS, LC3 48_4_2] Passed BAP/USR/SCC/BV-131-C [USR SRC Config QoS, LC3 48_5_2] Passed BAP/USR/SCC/BV-132-C [USR SRC Config QoS, LC3 48_6_2] Passed Total: 64, Passed: 64 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 219 insertions(+), 2 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 470f59d387e5..4bd5ef8b9847 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -2268,7 +2268,7 @@ static struct test_config cfg_src_48_6_1 = { */ #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_DATA(0x1b, 0x22, 0x00, 0x02, 0x01, 0x03, 0x00, 0x00), \ IOV_NULL, \ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x02, 0x00, 0x00, _qos) @@ -2744,7 +2744,7 @@ static struct test_config cfg_src_48_6_2 = { * 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) +static void test_ucl_scc_qos_lc3(void) { define_test("BAP/UCL/SCC/BV-035-C [UCL SRC Config QoS, LC3 8_1_1]", test_setup, test_client, &cfg_snk_8_1_1, @@ -2940,6 +2940,223 @@ static void test_scc_qos_lc3(void) SCC_SRC_48_6_2); } +/* 4.9.5 Unicast Server Performs Config QoS – LC3 + * + * Test Purpose: + * Verify that a Unicast Server IUT can perform a Config QoS operation + * initiated by a Unicast Client for the LC3 codec. + *. + * Pass verdict: + * In step 2, the IUT sends a notification of the ASE Control Point + * characteristic with Response_Code set to Success (0x00) for the requested + * ASE_ID and opcode. + * In step 3, the notified ASE characteristic value is correctly formatted, has + * the ASE_ID field set to Test_ASE_ID, the ASE_State field set to 0x02 + * (QoS Configured), and the Additional_ASE_Parameters field containing the + * CIG_ID, CIS_ID, and QoS configuration values requested in step 2. + */ +static void test_usr_scc_qos_lc3(void) +{ + define_test("BAP/USR/SCC/BV-069-C [USR SNK Config QoS, LC3 8_1_1]", + test_setup_server, test_server, &cfg_snk_8_1_1, + SCC_SNK_8_1_1); + define_test("BAP/USR/SCC/BV-070-C [USR SNK Config QoS, LC3 8_2_1]", + test_setup_server, test_server, &cfg_snk_8_2_1, + SCC_SNK_8_2_1); + define_test("BAP/USR/SCC/BV-071-C [USR SNK Config QoS, LC3 16_1_1]", + test_setup_server, test_server, &cfg_snk_16_1_1, + SCC_SNK_16_1_1); + define_test("BAP/USR/SCC/BV-072-C [USR SNK Config QoS, LC3 16_2_1]", + test_setup_server, test_server, &cfg_snk_16_2_1, + SCC_SNK_16_2_1); + define_test("BAP/USR/SCC/BV-073-C [USR SNK Config QoS, LC3 24_1_1]", + test_setup_server, test_server, &cfg_snk_24_1_1, + SCC_SNK_24_1_1); + define_test("BAP/USR/SCC/BV-074-C [USR SNK Config QoS, LC3 24_2_1]", + test_setup_server, test_server, &cfg_snk_24_2_1, + SCC_SNK_24_2_1); + define_test("BAP/USR/SCC/BV-075-C [USR SNK Config QoS, LC3 32_1_1]", + test_setup_server, test_server, &cfg_snk_32_1_1, + SCC_SNK_32_1_1); + define_test("BAP/USR/SCC/BV-076-C [USR SNK Config QoS, LC3 32_2_1]", + test_setup_server, test_server, &cfg_snk_32_2_1, + SCC_SNK_32_2_1); + define_test("BAP/USR/SCC/BV-077-C [USR SNK Config QoS, LC3 44.1_1_1]", + test_setup_server, test_server, &cfg_snk_44_1_1, + SCC_SNK_44_1_1); + define_test("BAP/USR/SCC/BV-078-C [USR SNK Config QoS, LC3 44.1_2_1]", + test_setup_server, test_server, &cfg_snk_44_2_1, + SCC_SNK_44_2_1); + define_test("BAP/USR/SCC/BV-079-C [USR SNK Config QoS, LC3 48_1_1]", + test_setup_server, test_server, &cfg_snk_48_1_1, + SCC_SNK_48_1_1); + define_test("BAP/USR/SCC/BV-080-C [USR SNK Config QoS, LC3 48_2_1]", + test_setup_server, test_server, &cfg_snk_48_2_1, + SCC_SNK_48_2_1); + define_test("BAP/USR/SCC/BV-081-C [USR SNK Config QoS, LC3 48_3_1]", + test_setup_server, test_server, &cfg_snk_48_3_1, + SCC_SNK_48_3_1); + define_test("BAP/USR/SCC/BV-082-C [USR SNK Config QoS, LC3 48_4_1]", + test_setup_server, test_server, &cfg_snk_48_4_1, + SCC_SNK_48_4_1); + define_test("BAP/USR/SCC/BV-083-C [USR SNK Config QoS, LC3 48_5_1]", + test_setup_server, test_server, &cfg_snk_48_5_1, + SCC_SNK_48_5_1); + define_test("BAP/USR/SCC/BV-084-C [USR SNK Config QoS, LC3 48_6_1]", + test_setup_server, test_server, &cfg_snk_48_6_1, + SCC_SNK_48_6_1); + define_test("BAP/USR/SCC/BV-085-C [USR SRC Config QoS, LC3 8_1_1]", + test_setup_server, test_server, &cfg_src_8_1_1, + SCC_SRC_8_1_1); + define_test("BAP/USR/SCC/BV-086-C [USR SRC Config QoS, LC3 8_2_1]", + test_setup_server, test_server, &cfg_src_8_2_1, + SCC_SRC_8_2_1); + define_test("BAP/USR/SCC/BV-087-C [USR SRC Config QoS, LC3 16_1_1]", + test_setup_server, test_server, &cfg_src_16_1_1, + SCC_SRC_16_1_1); + define_test("BAP/USR/SCC/BV-088-C [USR SRC Config QoS, LC3 16_2_1]", + test_setup_server, test_server, &cfg_src_16_2_1, + SCC_SRC_16_2_1); + define_test("BAP/USR/SCC/BV-089-C [USR SRC Config QoS, LC3 24_1_1]", + test_setup_server, test_server, &cfg_src_24_1_1, + SCC_SRC_24_1_1); + define_test("BAP/USR/SCC/BV-090-C [USR SRC Config QoS, LC3 24_2_1]", + test_setup_server, test_server, &cfg_src_24_2_1, + SCC_SRC_24_2_1); + define_test("BAP/USR/SCC/BV-091-C [USR SRC Config QoS, LC3 32_1_1]", + test_setup_server, test_server, &cfg_src_32_1_1, + SCC_SRC_32_1_1); + define_test("BAP/USR/SCC/BV-092-C [USR SRC Config QoS, LC3 32_2_1]", + test_setup_server, test_server, &cfg_src_32_2_1, + SCC_SRC_32_2_1); + define_test("BAP/USR/SCC/BV-093-C [USR SRC Config QoS, LC3 44.1_1_1]", + test_setup_server, test_server, &cfg_src_44_1_1, + SCC_SRC_44_1_1); + define_test("BAP/USR/SCC/BV-094-C [USR SRC Config QoS, LC3 44.1_2_1]", + test_setup_server, test_server, &cfg_src_44_2_1, + SCC_SRC_44_2_1); + define_test("BAP/USR/SCC/BV-095-C [USR SRC Config QoS, LC3 48_1_1]", + test_setup_server, test_server, &cfg_src_48_1_1, + SCC_SRC_48_1_1); + define_test("BAP/USR/SCC/BV-096-C [USR SRC Config QoS, LC3 48_2_1]", + test_setup_server, test_server, &cfg_src_48_2_1, + SCC_SRC_48_2_1); + define_test("BAP/USR/SCC/BV-097-C [USR SRC Config QoS, LC3 48_3_1]", + test_setup_server, test_server, &cfg_src_48_3_1, + SCC_SRC_48_3_1); + define_test("BAP/USR/SCC/BV-098-C [USR SRC Config QoS, LC3 48_4_1]", + test_setup_server, test_server, &cfg_src_48_4_1, + SCC_SRC_48_4_1); + define_test("BAP/USR/SCC/BV-099-C [USR SRC Config QoS, LC3 48_5_1]", + test_setup_server, test_server, &cfg_src_48_5_1, + SCC_SRC_48_5_1); + define_test("BAP/USR/SCC/BV-100-C [USR SRC Config QoS, LC3 48_6_1]", + test_setup_server, test_server, &cfg_src_48_6_1, + SCC_SRC_48_6_1); + define_test("BAP/USR/SCC/BV-101-C [USR SNK Config QoS, LC3 8_1_2]", + test_setup_server, test_server, &cfg_snk_8_1_2, + SCC_SNK_8_1_2); + define_test("BAP/USR/SCC/BV-102-C [USR SNK Config QoS, LC3 8_2_2]", + test_setup_server, test_server, &cfg_snk_8_2_2, + SCC_SNK_8_2_2); + define_test("BAP/USR/SCC/BV-103-C [USR SNK Config QoS, LC3 16_1_2]", + test_setup_server, test_server, &cfg_snk_16_1_2, + SCC_SNK_16_1_2); + define_test("BAP/USR/SCC/BV-104-C [USR SNK Config QoS, LC3 16_2_2]", + test_setup_server, test_server, &cfg_snk_16_2_2, + SCC_SNK_16_2_2); + define_test("BAP/USR/SCC/BV-105-C [USR SNK Config QoS, LC3 24_1_2]", + test_setup_server, test_server, &cfg_snk_24_1_2, + SCC_SNK_24_1_2); + define_test("BAP/USR/SCC/BV-106-C [USR SNK Config QoS, LC3 24_2_2]", + test_setup_server, test_server, &cfg_snk_24_2_2, + SCC_SNK_24_2_2); + define_test("BAP/USR/SCC/BV-107-C [USR SNK Config QoS, LC3 32_1_2]", + test_setup_server, test_server, &cfg_snk_32_1_2, + SCC_SNK_32_1_2); + define_test("BAP/USR/SCC/BV-108-C [USR SNK Config QoS, LC3 32_2_2]", + test_setup_server, test_server, &cfg_snk_32_2_2, + SCC_SNK_32_2_2); + define_test("BAP/USR/SCC/BV-109-C [USR SNK Config QoS, LC3 44.1_1_2]", + test_setup_server, test_server, &cfg_snk_44_1_2, + SCC_SNK_44_1_2); + define_test("BAP/USR/SCC/BV-110-C [USR SNK Config QoS, LC3 44.1_2_2]", + test_setup_server, test_server, &cfg_snk_44_2_2, + SCC_SNK_44_2_2); + define_test("BAP/USR/SCC/BV-111-C [USR SNK Config QoS, LC3 48_1_2]", + test_setup_server, test_server, &cfg_snk_48_1_2, + SCC_SNK_48_1_2); + define_test("BAP/USR/SCC/BV-112-C [USR SNK Config QoS, LC3 48_2_2]", + test_setup_server, test_server, &cfg_snk_48_2_2, + SCC_SNK_48_2_2); + define_test("BAP/USR/SCC/BV-113-C [USR SNK Config QoS, LC3 48_3_2]", + test_setup_server, test_server, &cfg_snk_48_3_2, + SCC_SNK_48_3_2); + define_test("BAP/USR/SCC/BV-114-C [USR SNK Config QoS, LC3 48_4_2]", + test_setup_server, test_server, &cfg_snk_48_4_2, + SCC_SNK_48_4_2); + define_test("BAP/USR/SCC/BV-115-C [USR SNK Config QoS, LC3 48_5_2]", + test_setup_server, test_server, &cfg_snk_48_5_2, + SCC_SNK_48_5_2); + define_test("BAP/USR/SCC/BV-116-C [USR SNK Config QoS, LC3 48_6_2]", + test_setup_server, test_server, &cfg_snk_48_6_2, + SCC_SNK_48_6_2); + define_test("BAP/USR/SCC/BV-117-C [USR SRC Config QoS, LC3 8_1_2]", + test_setup_server, test_server, &cfg_src_8_1_2, + SCC_SRC_8_1_2); + define_test("BAP/USR/SCC/BV-118-C [USR SRC Config QoS, LC3 8_2_2]", + test_setup_server, test_server, &cfg_src_8_2_2, + SCC_SRC_8_2_2); + define_test("BAP/USR/SCC/BV-119-C [USR SRC Config QoS, LC3 16_1_2]", + test_setup_server, test_server, &cfg_src_16_1_2, + SCC_SRC_16_1_2); + define_test("BAP/USR/SCC/BV-120-C [USR SRC Config QoS, LC3 16_2_2]", + test_setup_server, test_server, &cfg_src_16_2_2, + SCC_SRC_16_2_2); + define_test("BAP/USR/SCC/BV-121-C [USR SRC Config QoS, LC3 24_1_2]", + test_setup_server, test_server, &cfg_src_24_1_2, + SCC_SRC_24_1_2); + define_test("BAP/USR/SCC/BV-122-C [USR SRC Config QoS, LC3 24_2_2]", + test_setup_server, test_server, &cfg_src_24_2_2, + SCC_SRC_24_2_2); + define_test("BAP/USR/SCC/BV-123-C [USR SRC Config QoS, LC3 32_1_2]", + test_setup_server, test_server, &cfg_src_32_1_2, + SCC_SRC_32_1_2); + define_test("BAP/USR/SCC/BV-124-C [USR SRC Config QoS, LC3 32_2_2]", + test_setup_server, test_server, &cfg_src_32_2_2, + SCC_SRC_32_2_2); + define_test("BAP/USR/SCC/BV-125-C [USR SRC Config QoS, LC3 44.1_1_2]", + test_setup_server, test_server, &cfg_src_44_1_2, + SCC_SRC_44_1_2); + define_test("BAP/USR/SCC/BV-126-C [USR SRC Config QoS, LC3 44.1_2_2]", + test_setup_server, test_server, &cfg_src_44_2_2, + SCC_SRC_44_2_2); + define_test("BAP/USR/SCC/BV-127-C [USR SRC Config QoS, LC3 48_1_2]", + test_setup_server, test_server, &cfg_src_48_1_2, + SCC_SRC_48_1_2); + define_test("BAP/USR/SCC/BV-128-C [USR SRC Config QoS, LC3 48_2_2]", + test_setup_server, test_server, &cfg_src_48_2_2, + SCC_SRC_48_2_2); + define_test("BAP/USR/SCC/BV-129-C [USR SRC Config QoS, LC3 48_3_2]", + test_setup_server, test_server, &cfg_src_48_3_2, + SCC_SRC_48_3_2); + define_test("BAP/USR/SCC/BV-130-C [USR SRC Config QoS, LC3 48_4_2]", + test_setup_server, test_server, &cfg_src_48_4_2, + SCC_SRC_48_4_2); + define_test("BAP/USR/SCC/BV-131-C [USR SRC Config QoS, LC3 48_5_2]", + test_setup_server, test_server, &cfg_src_48_5_2, + SCC_SRC_48_5_2); + define_test("BAP/USR/SCC/BV-132-C [USR SRC Config QoS, LC3 48_6_2]", + test_setup_server, test_server, &cfg_src_48_6_2, + SCC_SRC_48_6_2); +} + +static void test_scc_qos_lc3(void) +{ + test_ucl_scc_qos_lc3(); + test_usr_scc_qos_lc3(); +} + static struct test_config cfg_snk_qos_vs = { .cc = IOV_NULL, .qos = QOS_UCAST, From patchwork Fri Apr 4 19:39:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878287 Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDD5B22538F for ; Fri, 4 Apr 2025 19:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795616; cv=none; b=O1RE8rcK8sg0CKlHcDO/iWpT8cAtswISXLzHZRMi9XG/IJfVlM1psdfPIROCNtp7Yo2EjW8G7mtSe85hMj/tEqQ1gETj4brQIzBbfnka7PQW4L7V8nX87D2eNu5pP3p6pdU5FVwf2lMT+C9fpX0mHh+P7hir7g1CEMH8yWC1xAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795616; c=relaxed/simple; bh=k4mTeg3N2nFLrcmIeFZW+iYlyOpN0M4pQPLjJ92/wXQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tL0xEINxf/tuEgj14OztoH444aEcPmSXXb8URtQWIYXoB+4OfI8pZmZRNFKKwya87eAWBm6AkOX3a36S03q0Tz71iXj/cHz353TwDJ7hAuQ5EQvxCx+CUbfWSoRsw1lXj2LW5l94o0qEuma5cvam9v4p/av3D8v7UzNgn+eS8LA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jwdihDRJ; arc=none smtp.client-ip=209.85.222.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jwdihDRJ" Received: by mail-ua1-f45.google.com with SMTP id a1e0cc1a2514c-86d3805a551so1090492241.3 for ; Fri, 04 Apr 2025 12:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795612; x=1744400412; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=MVaX20wo7w1Y3NZXUbSGU27hwlvxAUbfzuc80lnuofE=; b=jwdihDRJyvGBqXlorF0LfqwH/50W8Dd9QlgdTgXfS/Fc1qVEHjexgx13XedH6nMLtm 1CPtS1ZmdGq+jlvAcUlgD6S8NIolCXenuRTI/+oFd9Eiv9itmBYKq2la/jq/hzN/QwjF KUbhYPNirHyvpTRlCfPM5Kftr8KihI+6c5wfzfJ80h3WSOZdGh/AkJbEKh1DlkpEp8Ve OsdGM0olb2o/HnMnTRgY3j+M7OGr4UMyJzK/c5Ob6LdqACEsu7bZ7ofFNadpkwskB2+9 1Q0jF/7JxsqAAIHaU6GHDPhCFgEez4TUV1NpYN5joPLvVjPZgqkl+AzhxzVQ7sd1CMfu 5QdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795612; x=1744400412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MVaX20wo7w1Y3NZXUbSGU27hwlvxAUbfzuc80lnuofE=; b=GfpacfGao6je9iZiRpqr69Kq+D9RH26IAHLDneEXUy+Zn8snO8F3uGrb0Cb1XkFdkA 3CWQr4QR5Ky3ZMp6fntNYGCVA2+orlgfbrX4+C7dhg5jwoABdV2mn4E1LaBJP1lwi7cf Mjhd32sWvbzwgfUxJGKFNqDsNdK5ZbyQMqJsVdwBzCEePf/d035moal9lwcoksnh3Ni8 im1GvG2DQtaARsqy5H+DDTiRd25egtPNV/kFOeZBeoWBR1LJAo/JAVYc8PhTbjLzrZUg A4e+Q99dbg8B1cq1wjKEgq8V6jANGNvJ0NDcf/dVEMFzuiaO5paJLBXFMjC7ro6+eoK5 0B0g== X-Gm-Message-State: AOJu0YzqzC/+XLpj/x+hr9Z03YgK65FoLJ/opqVO9mY9emWFa0OtMOZz wpY8Uga+IJw/uZOXdZHhGHZHvAnrALOavG13yRyNfDZdhFByqkFkaMBeFjzDOtA= X-Gm-Gg: ASbGncs9Ax2ACizZQOL4ROhrWfYQQtYMzKSe+GWxzg43h4VgXZwJlXs5O0trN1bvPW4 ueA9VgaByskFZ/gemy+Rfoh8p9QO8mpqljZfnVikBpdnwfn3YIX82BecOQLgWsdh2zctfsCTSvZ o0ckrMYAyS9fQY/EzJKW+gyOtJD1+/buaMznopgq0ZaRWtBfrOfV3SiOJA2AZllKmLdoa3ujY+K 2fyVclzK9tr7DwxIXNn81xnUGQDyNPc0I+QjJI/EEEIbPp43ifAxpKwhWMfKhEF/7FxFGNfcFwz jPwPYuFW20YFsAe0DOaO4Y3vM38Z512IZvmfo41tsKKCiitYpbmCaiz+QtdxxXSNjXssW7k2h2G trzX3xDrCeQ+dsQ== X-Google-Smtp-Source: AGHT+IGe5Gk5lxTsw2zZ0Cgd1jzYbcQjaudNcjfd0Mz3vCwJCj4q2no3OlfRjzLYaAQDFFsf13uIYg== X-Received: by 2002:a05:6102:334c:b0:4bb:d7f0:6e70 with SMTP id ada2fe7eead31-4c85537fe64mr4065280137.5.1743795611989; Fri, 04 Apr 2025 12:40:11 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:10 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 05/11] test-bap: Introduce USR/SCC QoS tests for VS Date: Fri, 4 Apr 2025 15:39:43 -0400 Message-ID: <20250404193959.359008-6-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Unicast Server Performs Config QoS – Vendor-Specific Test Purpose: Verify that a Unicast Server IUT can handle a Config QoS operation for a vendor-specific codec. Pass verdict: The IUT sends a notification of the ASE Control Point characteristic with Response_Code set to Success (0x00) for the requested ASE_ID and opcode Test Summary ------------ BAP/USR/SCC/BV-133-C [USR SNK Config QoS, VS] Passed BAP/USR/SCC/BV-134-C [USR SRC Config QoS, VS] Passed Total: 2, Passed: 2 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 4bd5ef8b9847..7edb8d8a9b7d 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -2940,7 +2940,7 @@ static void test_ucl_scc_qos_lc3(void) SCC_SRC_48_6_2); } -/* 4.9.5 Unicast Server Performs Config QoS – LC3 +/* Unicast Server Performs Config QoS – LC3 * * Test Purpose: * Verify that a Unicast Server IUT can perform a Config QoS operation @@ -3191,16 +3191,42 @@ static struct test_config cfg_src_qos_vs = { * 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) +static void test_ucl_scc_qos_vs(void) { define_test("BAP/UCL/SCC/BV-099-C [UCL SNK Config QoS, VS]", test_setup, test_client, &cfg_src_qos_vs, SCC_SRC_QOS_VS); - define_test("BAP/UCL/SCC/BV-100-C [UCL SRC QoS Codec, VS]", + define_test("BAP/UCL/SCC/BV-100-C [UCL SRC Config QoS, VS]", test_setup, test_client, &cfg_snk_qos_vs, SCC_SNK_QOS_VS); } +/* Unicast Server Performs Config QoS – Vendor-Specific + * + * Test Purpose: + * Verify that a Unicast Server IUT can handle a Config QoS operation for a + * vendor-specific codec. + * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic with + * Response_Code set to Success (0x00) for the requested ASE_ID and opcode. + */ +static void test_usr_scc_qos_vs(void) +{ + define_test("BAP/USR/SCC/BV-133-C [USR SNK Config QoS, VS]", + test_setup_server, test_server, &cfg_snk_qos_vs, + SCC_SNK_QOS_VS); + define_test("BAP/USR/SCC/BV-134-C [USR SRC Config QoS, VS]", + test_setup, test_client, &cfg_src_qos_vs, + SCC_SRC_QOS_VS); +} + +static void test_scc_qos_vs(void) +{ + test_ucl_scc_qos_vs(); + test_usr_scc_qos_vs(); +} + static struct test_config cfg_snk_enable = { .cc = LC3_CONFIG_16_2, .qos = LC3_QOS_16_2_1, From patchwork Fri Apr 4 19:39:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878639 Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13107224238 for ; Fri, 4 Apr 2025 19:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795617; cv=none; b=AlughO4pAAY6Hr6ghAOubna4JQ4XJq9723Wstc+DdZnlJWPkjtz3RxkPQ8cetRb6M4+hV63eNLUv6Jj8erCP9eLwcmxbJYSsal9DWE9tRp3d6KAWz4anfN5HyYf4gAoxZfDkKjrb27UULOXtcYVDshsqPAeBMBEB0tzRj94FNMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795617; c=relaxed/simple; bh=FTq5/V+iogtJeZkC/UenAFmUAy06o6f90boKqROll7Y=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XuslT24Fs+JFsJBebhtaiqv/ex5hDBhk2ChMEWEGXz2+F4HtTjBGXmpeMXom5cuJWtpwU3dPTpTk26h2g4NS8fYsIwyti9i+nS1muHYf5uBt5aqbr+zyqlQZKBsdQgdiIX6GazE8VNObthaNE/Hc0U19Pgz/v/zsFQCGMr9wfbs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ixiEpbcD; arc=none smtp.client-ip=209.85.221.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ixiEpbcD" Received: by mail-vk1-f171.google.com with SMTP id 71dfb90a1353d-5262475372eso1186787e0c.2 for ; Fri, 04 Apr 2025 12:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795614; x=1744400414; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=t/ot1Gcq7j/PUQT5etOON0qwHsX7Yfvn6hVkJYnsevY=; b=ixiEpbcDodxRF64vTtvfFkaTunThhOtuxAVDHaEl4NV86F3HWads/q4BZW9EnsAQ87 P+abZ2yZDdt+E9NhdNhsDGS5B1g31Y3szVN0bLfoZRo5UldHzrPY4Wj0De2Acey7Knqf 22LRhgqtHwGfyFwuJazGPMcRlqeuboBUBEaxLZZApS5CE75rhtHWQoHv6l3SbMwjIHod mx8YkDZfDu3TjHbasfP2f2WShdLFwj6sgERBeqxi8hQJtb7Rf924bWq0Y5woHpfMJX2u QHnKlQrTT7o1uTNZDWVMyl9nyj5EW1rhj0KvkXqGnZUOiTYenAEqaxMj6jLAXcQEnfcd SnJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795614; x=1744400414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t/ot1Gcq7j/PUQT5etOON0qwHsX7Yfvn6hVkJYnsevY=; b=mU+Ra8bs/uukwoHbc/ZcWdrF/w4xYOGvNuYacJ4GVwjhAylpP7Fcx0aZZxOkRVpkcS LkyStRMt6MuzH+KdqFugGfw+O1GQ/iKfr+Vr9OjHS+j03mjFKlxtmBfg0/FDtAF3K6dV Qga6GFijgAQILNC1kRCurFbSP6N/ZiLajafWueZex8Z7WaABAWMelZI8XcIAx6KlytwQ /Xt76Uk0c4oNqjve+7GwbTUU613sw9HvtK+7LBsrcIA91e5IYRzWHJ0Qb9Zi/FkGu5G4 XW0c3FDQ32jwsY92clS42zRYFV/k/XPzKvDaK0pGi24y27f3IUeb3c0PCHvcAqX0fd0V 6zvw== X-Gm-Message-State: AOJu0YwUWs8F/31QiUJ+5Irbqjh5P21WeekxoghYTuUKBneUlz2nIhlA M2gWyFvBhKWhtwJjBX7gkIZtbM3wVGWzb5sHoCUEjl0vKoL+64kdU8IBqD+xncA= X-Gm-Gg: ASbGncuu920i7Dxt1E+yorb6B2Tbf+stxcTBKlJWN0u0udRrXvcjy/pHyzpegau8ngB OPrkjJX8G0UUoJsqVwEOEQf7/J3qoNLFTDfg3JC/3rrFF6beaA6r3PB+oMnseL9bPIiM3gpaoW2 MMA/wJ+e/9BKumR5jUOofXK94uhF/XNDvr0ReT+8KcyZPgBEu9dRNIJWjltSYqZwyRQQfD2a+Zp SRA2yyL9bHMKqcyiwo/pWmWj9tjgX5IYnR9IXTp3VB9JoZc0qzdV2zDUHZ4otdWoREDDXb1Wms7 w7htX1NXvf00Y4Z8cS6T9kHNqu25GHL350KKoyyvevDK+XnsBpMo8LUF4+3WmqgVLJwKK/w3trn UdFvWVFvGihVuNA== X-Google-Smtp-Source: AGHT+IHadNGvjc2W+wd6Jwui2FPnQVXKcSVgPcIhUqtYYELYYeniEC3U5pTc50JRxfrGy4OQ3LBCPg== X-Received: by 2002:a05:6102:5681:b0:4b2:c391:7d16 with SMTP id ada2fe7eead31-4c8568c14afmr3898000137.7.1743795613972; Fri, 04 Apr 2025 12:40:13 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:12 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 06/11] test-bap: Introduce USR/SCC Enable tests for LC3 Date: Fri, 4 Apr 2025 15:39:44 -0400 Message-ID: <20250404193959.359008-7-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Unicast Server Performs Client-Initiated Enable Operation Test Purpose: Verify that a Unicast Server IUT can handle a client-initiated Enable operation for an ASE with a Unicast Client that is either in the Audio Sink role or the Audio Source role. Pass verdict: The IUT sends a notification of the ASE Control Point characteristic with Response_Code set to 0x00 (Success) for the requested ASE_ID and opcode. Test Summary ------------ BAP/USR/SCC/BV-135-C [USR SNK Enable] Passed BAP/USR/SCC/BV-136-C [UCL SRC Enable] Passed Total: 2, Passed: 2 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 7edb8d8a9b7d..5edcc739b675 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -3273,7 +3273,7 @@ static struct test_config cfg_src_enable = { #define SRC_ENABLE \ IOV_DATA(0x52, 0x22, 0x00, 0x03, 0x01, 0x03, 0x04, 0x03, 0x02, 0x01, \ 00), \ - IOV_DATA(0x1b, 0x22, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00), \ + IOV_DATA(0x1b, 0x22, 0x00, 0x03, 0x01, 0x03, 0x00, 0x00), \ IOV_NULL, \ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x03, 0x00, 0x00, 0x04, 0x03, 0x02, \ 0x01, 0x00) @@ -3291,7 +3291,7 @@ static struct test_config cfg_src_enable = { * 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) +static void test_ucl_scc_enable(void) { define_test("BAP/UCL/SCC/BV-101-C [UCL SRC Enable]", test_setup, test_client, &cfg_snk_enable, @@ -3301,6 +3301,33 @@ static void test_scc_enable(void) SCC_SRC_ENABLE); } +/* Unicast Server Performs Client-Initiated Enable Operation + * + * Test Purpose: + * Verify that a Unicast Server IUT can handle a client-initiated Enable + * operation for an ASE with a Unicast Client that is either in the Audio Sink + * role or the Audio Source role. + * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic with + * Response_Code set to 0x00 (Success) for the requested ASE_ID and opcode. + */ +static void test_usr_scc_enable(void) +{ + define_test("BAP/USR/SCC/BV-135-C [USR SNK Enable]", + test_setup_server, test_server, &cfg_snk_enable, + SCC_SNK_ENABLE); + define_test("BAP/USR/SCC/BV-136-C [UCL SRC Enable]", + test_setup_server, test_server, &cfg_src_enable, + SCC_SRC_ENABLE); +} + +static void test_scc_enable(void) +{ + test_ucl_scc_enable(); + test_usr_scc_enable(); +} + static struct test_config cfg_snk_disable = { .cc = LC3_CONFIG_16_2, .qos = LC3_QOS_16_2_1, From patchwork Fri Apr 4 19:39:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878286 Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7B74225A5B for ; Fri, 4 Apr 2025 19:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795619; cv=none; b=hF/Y4Yp2upIsxsCOrRQQ8Rj2b5aI/8pg69064NkH5wN6vufsPm8xqglQkMKKP9TCZkwKG7GgIZTM2rMNCWh3IYWyHqoIM/09jOvSe7gdaVyR+4PEL08eDUPAEkyd1WNKByrB7S8VOccvvHH4jfufQrVR5pttX54ovbBInNQDsPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795619; c=relaxed/simple; bh=csyXIAGZsx/4/kbyX+yl4X0nadT51zQGk9f42m+3hFI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jQU5KWXO0Ss4UelEgK9v1E2+EWJezJ2/rLtdyzypgiXh02JZPD3GRUYmT99daMjsW3WgxVIk1gWrJOavWx0+Q38YErxuYyJ1ApPDW4zrFu7oZD2MciBQvkWv/1Wa9ivzbSBynC0/iT1/aF5+tqiB3/sCcxAqBguIOiidbV9p+DE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=H1tg/wz8; arc=none smtp.client-ip=209.85.222.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H1tg/wz8" Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-86d377306ddso1102589241.2 for ; Fri, 04 Apr 2025 12:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795616; x=1744400416; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=abiJZqZPSgloceKnqEePK/H3ytaF6NiSgkualltBJX8=; b=H1tg/wz8NqjitzvR7toU7P8NBFvnMXxMxSBwauKxb/S5IG6dEFYAXLGhe9qN731FNT I6fSfEKnyMc47GIbwwUSXt2uoaUGsXP3KGc2Y4/PevKF3IyqNPMBcD9p8lX+Pi0NtCdM 6id0Kq3fa98btl1BG+ffgUZ/vjohMrwQSfOiaaTTI0sb4vF0fvqIwjFpn7/BEh788OgU G3Tci898PXUV2iDO1tp1Yh+GfCwr+dTK4dqK4y/wJuESS0LGH8V9JMZduARxVLvNHGNV LzoCAodfIQQ6b9kECbWloQ5dhXMIC+CJ+H2mJ8MnDBfEOe4wMGVZ8GOGiSC1LaoPDRy/ QHKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795616; x=1744400416; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=abiJZqZPSgloceKnqEePK/H3ytaF6NiSgkualltBJX8=; b=GBq3zMlpkxNs+r7zAXD9BEmupMbYR4D9eZoTUVWlTa7a2Czcpi4yfbV9ttfK2YvIGV 5UgaPSwR+b8wT+Gmqm+HTIYY9Fmt6r4W2QC/Xri6IFfTS3UHzFUD1xGg+68iQA5v3nC7 ipq4My9GGRMOto9/YiZ58BtlWb5QOYfxK/+5Onb5C6tqGJw2BdsXO1y8lcwajQXBLQaD yw5Q0GsGio4mbZzkBUvPhHqoOQudKgXfUorT8zlRwm+QT+rA0FqosCo088PaXkPkqV25 oXQ/PTLnjsuG+s73hPpdhQKIdAdzkbK7uZkCmFQ2Cp5BbWYndZCHmfxO6elkQi9XNbd7 51VA== X-Gm-Message-State: AOJu0YynBzKvE9tQw3cCvklAStCUWQDKxEu2JZ2nxL4wigVfVJRFAVZE CdR/3SZAhSPcuVCYPmBp3WhNEIr546JAmXiHosPCzP7N0jcs7huj8vuZU30y2PA= X-Gm-Gg: ASbGncsmG2Ggz4uOce6H5jaP+0nLDIKU3G1v0fdGgzKqsCe22BH7xLWuogAiGQoXTaQ DtiVrW5syx0sJWLgARurrGiZtFq+tXymrZjb5ZjSlEgjm/O2ruiK+WISB2vcXiYv+r5x9ir9Pi4 1kBCWeQ4V09sn3AFhKId3uR6GAaeUfBi+njNOZTLrQbbbB/9x29MQm9Fk0ZhXE8Xon9s1dYXhxo FOk++h2UMo23napd1IDJzha2WDhRdyOSaAz42dLOpmFHVJKGfkbV9osu+woSW6vmxI81WHldPuh EJhDZ4135cgWRbENN5xhcBGjnJ7hVNeSx1qQjUT8PjlX1LrzN+YLUasGq1cEhQ9qROkpwqFEmvW T6bGG7fS7MxS28Q== X-Google-Smtp-Source: AGHT+IGaSSQPynYR3la62Ef29Wf1zndMcFBOH3HoprRP/Q19C0Rs8Vf/+6ZCNkCCheygeSZ1VBYf2A== X-Received: by 2002:a05:6102:38d4:b0:4c1:a66f:a468 with SMTP id ada2fe7eead31-4c86378748amr602337137.22.1743795615828; Fri, 04 Apr 2025 12:40:15 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:14 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 07/11] test-bap: Introduce USR/SCC Enable tests for LC3 Date: Fri, 4 Apr 2025 15:39:45 -0400 Message-ID: <20250404193959.359008-8-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Unicast Server Performs Client-Initiated Disable Operation Test Purpose: Verify that a Unicast Server IUT can perform a client-initiated Disable operation for an ASE in the Enabling or Streaming state. Pass verdict: The IUT sends a notification of the ASE Control Point characteristic. Test Summary ------------ BAP/USR/SCC/BV-137-C [USR SRC Disable in Enabling State] Passed BAP/USR/SCC/BV-138-C [USR SNK Disable in Enabling or Streaming state] Passed BAP/USR/SCC/BV-139-C [USR SRC Disable in Streaming State] Passed Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 5edcc739b675..73dac275907e 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -3349,8 +3349,8 @@ static struct test_config cfg_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, \ + IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x02, 0x00, 0x00, 0x10, 0x27, 0x00, \ + 0x00, 0x02, 0x28, 0x00, 0x02, 0x0a, 0x00, 0x40, 0x9c, \ 0x00) #define SCC_SNK_DISABLE \ @@ -3378,9 +3378,8 @@ 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, 0x05, 0x00, 0x00, 0x4c, 0x1d, 0x00, \ - 0x00, 0x02, 0x1a, 0x00, 0x04, 0x08, 0x00, 0x40, 0x9c, \ - 0x00) + IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x05, 0x00, 0x00, 0x04, 0x03, 0x02, \ + 0x01, 0x00) #define SCC_SRC_DISABLE \ SCC_SRC_ENABLE, \ ASE_SRC_DISABLE @@ -3439,7 +3438,7 @@ static struct test_config cfg_src_disable_streaming = { * 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) +static void test_ucl_scc_disable(void) { define_test("BAP/UCL/SCC/BV-103-C [UCL SNK Disable in Enabling State]", test_setup, test_client, &cfg_src_disable, @@ -3453,6 +3452,35 @@ static void test_scc_disable(void) SCC_SRC_DISABLE_STREAMING); } +/* Unicast Server Performs Client-Initiated Disable Operation + * + * Test Purpose: + * Verify that a Unicast Server IUT can perform a client-initiated Disable + * operation for an ASE in the Enabling or Streaming state. + * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic. + */ +static void test_usr_scc_disable(void) +{ + define_test("BAP/USR/SCC/BV-137-C [USR SRC Disable in Enabling State]", + test_setup_server, test_server, &cfg_src_disable, + SCC_SRC_DISABLE); + define_test("BAP/USR/SCC/BV-138-C [USR SNK Disable in Enabling or " + "Streaming state]", + test_setup_server, test_server, &cfg_snk_disable, + SCC_SNK_DISABLE); + define_test("BAP/USR/SCC/BV-139-C [USR SRC Disable in Streaming State]", + test_setup, test_client, &cfg_src_disable_streaming, + SCC_SRC_DISABLE_STREAMING); +} + +static void test_scc_disable(void) +{ + test_ucl_scc_disable(); + test_usr_scc_disable(); +} + static void bap_release(struct bt_bap_stream *stream, uint8_t code, uint8_t reason, void *user_data) From patchwork Fri Apr 4 19:39:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878638 Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com [209.85.222.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 123EF227586 for ; Fri, 4 Apr 2025 19:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795622; cv=none; b=KVfbjfwt4GJLMLdZQH9C+ALyAoVVMLsG+ohHJc3TySP5nZ7/I+v6IZUMBR8wX+fHiqHCFWOfp0eMpe6ZbUFD5ux2/u/bDlRTT/Ct7m25DA7b0uTvMaDPWy85eJomJhARfV7nijCCVQLABRCjFLn0h1swqp147q/3YiYbBA9f9+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795622; c=relaxed/simple; bh=6MTuJY3lF3nXkrFWIUCXlfQcdvNEPpg1b9L01pRqFtE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nI2BoMgaGXeuV5X8VkhoG0TFSS4fNP6lfQb2SQXlRTnCUzSebxBTGpnQSpFW8iOxPwagjXf1NAm2zTczvAPubNu2AWkD1bnHjOC5AO3/SacOOMnciHIkW9Al4KcXOt/8j7xQdWvekeF0xMLjCGyHDL/K+mLRIyTVuNsKR9F6bWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UrLGILAk; arc=none smtp.client-ip=209.85.222.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UrLGILAk" Received: by mail-ua1-f42.google.com with SMTP id a1e0cc1a2514c-86d6fd581f4so2944697241.1 for ; Fri, 04 Apr 2025 12:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795618; x=1744400418; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=hKrVRoyW78yEO2SQvS5IegOdCkHEtUZJqpDGV6Xy6o8=; b=UrLGILAkZjStemssUcmt5ZmpAM9JE2etxVZIjQihyghUl2Hjg65fY7pXnBObWYBwRE 5XWmm0ybiZF4t9Pismih7RAVheT3pLGy9YCn5js3plzXoxSXr59k/kZxjnJlWSGnYU2C JSEuI4uHkdBHDuxvyaky67o6DAfm56tHatXClbcDUE5GQXvh1ZrSZRvlwQAuEUh/kuA/ 3ho2hijFD2P6lMGRkyBIREiHApcNh7KAZkIRZoVVnG/4cDo71mhqFCRA6eI65A7A13VQ 9fM0SYIrAoWFBqtP+8+Vbm5g8O6odb2gkdkeKw4uYzaT6G+dO6vu/E2/Zl+F1LfVrl8O HGQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795618; x=1744400418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hKrVRoyW78yEO2SQvS5IegOdCkHEtUZJqpDGV6Xy6o8=; b=ixRKp1eT2IPU48gTGba/23OxY3Uv4m+QV46Fx+rjHRgsKjZabYypuP+a6B3RpKQiZX F+XRv4hg7XipKx6xX2dYj2YkZWZqhNN7Twho3TeOrVPbx+kWcmQq+AiydbGkTR27WXx3 g92sLCCSg9ToH2yf0tAwU6GHl6kd+KYNpGfj6C1YLqAHvuJbsJMURYToBmnpSzRxYG0Q BSgpouM/ZFymvhkbx3XVJPyjqN3J4h/PUwVcgzhVqyJLAQ/CBocUUZ+fkaRPqbcXEQA5 5JC3khecAxgMoPzpsfmAY8wVIEkoorGKcBCwLt7P63+0x14shNWqVcnr7wl/gRXez4Ce QV4g== X-Gm-Message-State: AOJu0YzT9tWAh/h12gd2RYHIyZi919Num/lsBq75p0X3QDCtWq/p4G73 kgXN2PR+bSC8Otb6HqA9+8+QJtMSFK6c9xrjPNg7qIgzQssr2JoZJ+TTydgUL60= X-Gm-Gg: ASbGncuIT40NfZ1vmj4jQ2Umyqx+v6F17hfMgqpv+C6LEZ3r5apbV6YbfxcGJbesxq0 lKrnXrCqW+WZAP+T3FL04PLb4fzlkMAMkGiP9iviPXogWdinjQMzzw1cOPGdoFDO0vW7ciZy4vT 0grXEBlB8nHHfxJqaAEy7+glwi2PyrJNC9FtLiDtTl2+VDa1SdDkH7w0lYvon1vXPJtQFCVUGis K8o29Nx9hEbcKm9SV7w3LoAJsBkmzSYrU4GSjqp2cfq62cdU58aFWLEtgkjk9SnnnIFW5hIBWUa OXrbGno94AlfvvmV+SGycqXnNG8gvNSnfxWagyulqgVwMFmeblyavy+1Fmodxys4xcnFqaONeq9 xCyq3DjSDkFoNUA== X-Google-Smtp-Source: AGHT+IF+UWbd/b1wdgpeCaKHdGcbEura6KxfSSF7vMpu8zUGQP4cB9NFokHrvBWIQP2p0g2ZbeXYww== X-Received: by 2002:a67:be02:0:b0:4c1:8ded:2d66 with SMTP id ada2fe7eead31-4c845b9933dmr6742303137.12.1743795618024; Fri, 04 Apr 2025 12:40:18 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:17 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 08/11] shared/bap: Fix not always sending Releasing state Date: Fri, 4 Apr 2025 15:39:46 -0400 Message-ID: <20250404193959.359008-9-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz In order for states to be sent the stream cannot be freed since pending_states could be pending due to be processing a CP operation, so this attempts to grap a reference to the stream so it is not freed while states are pending. --- src/shared/bap.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 650bea2f4e8d..73d1b6192843 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1283,8 +1283,10 @@ static void bap_abort_stream_req(struct bt_bap *bap, queue_remove_all(bap->reqs, match_req_stream, stream, bap_req_abort); } -static void bt_bap_stream_unref(struct bt_bap_stream *stream) +static void bt_bap_stream_unref(void *data) { + struct bt_bap_stream *stream = data; + if (!stream) return; @@ -1308,7 +1310,6 @@ static void bap_ucast_detach(struct bt_bap_stream *stream) queue_remove(stream->bap->streams, stream); bap_stream_clear_cfm(stream); - stream->ep = NULL; ep->stream = NULL; bt_bap_stream_unref(stream); } @@ -1751,6 +1752,16 @@ static bool stream_notify_state(void *data) return false; } +static struct bt_bap_stream *bt_bap_stream_ref(struct bt_bap_stream *stream) +{ + if (!stream) + return NULL; + + __sync_fetch_and_add(&stream->ref_count, 1); + + return stream; +} + static void bap_ucast_set_state(struct bt_bap_stream *stream, uint8_t state) { struct bt_bap_endpoint *ep = stream->ep; @@ -1771,7 +1782,8 @@ static void bap_ucast_set_state(struct bt_bap_stream *stream, uint8_t state) else if (!stream->state_id) stream->state_id = timeout_add(BAP_PROCESS_TIMEOUT, stream_notify_state, - stream, NULL); + bt_bap_stream_ref(stream), + bt_bap_stream_unref); else /* If a state_id is already pending then queue the old one */ queue_push_tail(stream->pending_states, UINT_TO_PTR(ep->old_state)); @@ -2258,16 +2270,6 @@ static unsigned int bap_ucast_release(struct bt_bap_stream *stream, return req->id; } -static struct bt_bap_stream *bt_bap_stream_ref(struct bt_bap_stream *stream) -{ - if (!stream) - return NULL; - - __sync_fetch_and_add(&stream->ref_count, 1); - - return stream; -} - static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) { struct bt_bap *bap = stream->bap; From patchwork Fri Apr 4 19:39:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878285 Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB03A227B94 for ; Fri, 4 Apr 2025 19:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795623; cv=none; b=lf5mAsEuScle0pkCzdu19qzpycjS++URl86x+kTZznfbEQ5d8rIMHkANweT22/NterfjpZsqByFev2Cg3bytyxZtptCxCPvrhXGw/Inz15HA8qcKaFzc+hYEAqyplNxvANvDt4R0+pNswg0b7kQQsILu0PPgkPUL2Pcz+7x+Tds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795623; c=relaxed/simple; bh=sUscmQJlqFR2lS0AjSQV2lEVK/T+ghgD+cWQTpeyb20=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IBHp0b0wzPLXQok2OMbjx3kEXpmn8vd+21iHp5xzcSE2mEixhuD2mrJw0hcQCIghVf1YS09mvoP4T8COc8VoLsKJYQlfjFDNa5g1HMtFVAuwM1vp9UYeG1BdQYq6GAj7HXzLolnv6PZW4VKpj/xDBuohP1xR+Ehv3h+3XKv5lxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ElZBIUHJ; arc=none smtp.client-ip=209.85.221.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ElZBIUHJ" Received: by mail-vk1-f174.google.com with SMTP id 71dfb90a1353d-523ffbe0dbcso2430234e0c.0 for ; Fri, 04 Apr 2025 12:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795620; x=1744400420; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mjGAIa1i+etugNmeAp6Vtd5kmpIXm+DHp1189Qjs204=; b=ElZBIUHJapISB3+Ke/UzbMfmqFySffRG6zAEkdJyRbtvPcSHfSJ9Mn7XcwtYEG2yhq v8NXd9Ig9/mZK8sejBWDPlJCozC2ENF96cFzqSSglKIoORRGY7QcG6TgTEhLtn23rIq6 +sg2rIF1vusuV50chomF/GNCc7qm0r98ptD/CSeaGFDRegkdjQ8egRYB7mFaULilT4BG EAo2Ktk/CHETxMDrRvA+uTQonznastLLkWMgDnO56ZBYyASbwAzFyuDtMVe6ExO6k1V3 h/pDg4Q9kZ2pTVcdlrgSNJhduAUP0FekUsbdzUG3lKM/Ea2SXsAyw6rbXHPn5XlWAKnM IRvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795620; x=1744400420; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mjGAIa1i+etugNmeAp6Vtd5kmpIXm+DHp1189Qjs204=; b=dcnDu5uAmQmc/kbdeT6YO45u3lHoSlLE2j84F9WTrxZUKuZsT3C0F0IzcqxJbtT0R8 98rCH3iBYmIIO4ZBNe3yCELh+bmqM3lZq0Usx6qNDbjNz+qGkTqGiEcjqhtEk6l4a6OP F5mNGMC4XZmPIvppzCj3U9ZSxAzUOoimzrXstM6TJmA/4flHiUNXXr8UZKnHk58m92e7 6jw3KSd06ROp/4Q+TrGvcLFMVr/MnO3LukzmTgVGUSsHSViKdp2GJPY3AEXMLoIpTR+M FCfMN6t4wa3ZM3oelmQDfO8HtXARKUyRHbJ8UiVg3b46Vvi/PcyVefvN5YewANGI/dvO blqg== X-Gm-Message-State: AOJu0Yy+9lwL25mKKiqJJFNVRFkWtWdoswG4hplDJecDyJ+t3Tlxq5Va LdsQ7/H2hN2LuBiRSqanidFY7Xdm5lTJybuaQZLbINM1JspdshlArcIghPWrbtc= X-Gm-Gg: ASbGncsf3vQINSsnfYYhlODTUqcRFi/4TGUnWfo9sc+BKQ5j31R2kq1mqUZCJK+waBg U6AXJSrcg7Pe12k/wiIPvV7EDyncOUAipehzhXvwHW75b1+sknTKUi2RdfjWDjloKH85iuPRnDD jW4K1cNPHgD3KuY/HO3k29++8Ov2MqH46+a718kqEog9fiN1H7rCyNvHlZSVhpOjRGxCy93oBKo Ajil+fmnTlWZtuGrgPqWu7vc4Uujnl3gPebnEI2QF0j8ovNcEiRX/q67oU5Y8I6PU6x2RxTR1yp DBvMFuV7IQoPp97NRqSf60D7U9h1Ug2FX6SRzaIYXe+0iTM3dx1GgGypn+J0+TqG4oVsDaSAX9r MwoaGgHnwW0Q8sA== X-Google-Smtp-Source: AGHT+IF0EzRqTrJm6ASMIEYfWxpo9204kOgSTNUVFAl8x+UjeWoKTWmXvy6a3fgRVMY44dEZPcDsGQ== X-Received: by 2002:a05:6102:15a4:b0:4bf:fb80:9429 with SMTP id ada2fe7eead31-4c86364e93dmr769415137.4.1743795619813; Fri, 04 Apr 2025 12:40:19 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:19 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 09/11] test-bap: Introduce USR/SCC Release tests for LC3 Date: Fri, 4 Apr 2025 15:39:47 -0400 Message-ID: <20250404193959.359008-10-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Unicast Server Performs Client-Initiated Release Operation Test Purpose: Verify the behavior of a Unicast Server IUT when a Unicast Client initiates a Release operation. Pass verdict: The IUT sends a notification of the ASE Control Point characteristic value. Test Summary ------------ BAP/USR/SCC/BV-143-C [USR SRC Release in Codec Configured state] Passed BAP/USR/SCC/BV-144-C [USR SNK Release in Codec Configured state] Passed BAP/USR/SCC/BV-145-C [USR SRC Release in QoS Configured state] Passed BAP/USR/SCC/BV-146-C [USR SNK Release in QoS Configured state] Passed BAP/USR/SCC/BV-147-C [USR SRC Release in Enabling state] Passed BAP/USR/SCC/BV-148-C [USR SNK Release in Enabling or Streaming state] Passed BAP/USR/SCC/BV-149-C [USR SRC Release in Streaming state] Passed BAP/USR/SCC/BV-150-C [USR SRC Release in Disabling state] Passed Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 56 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 73dac275907e..c77fc83d83de 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -1160,10 +1160,6 @@ static void bap_attached(struct bt_bap *bap, void *user_data) data->bap = bap; bt_bap_set_debug(data->bap, print_debug, "bt_bap:", NULL); - - if (data->cfg && data->cfg->state_func) - bt_bap_state_register(data->bap, data->cfg->state_func, NULL, - data, NULL); } static void test_server(const void *user_data) @@ -3525,7 +3521,7 @@ static struct test_config cfg_src_cc_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) + IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x06) #define SCC_SRC_CC_RELEASE \ SCC_SRC_16_2, \ @@ -3552,7 +3548,7 @@ static struct test_config cfg_snk_cc_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) + IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x06) #define SCC_SNK_CC_RELEASE \ SCC_SNK_16_2, \ @@ -3699,7 +3695,7 @@ static struct test_config cfg_src_disable_release = { * 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) +static void test_ucl_scc_release(void) { define_test("BAP/UCL/SCC/BV-106-C [UCL SNK Release in Codec Configured" " state]", @@ -3732,6 +3728,52 @@ static void test_scc_release(void) SCC_SRC_DISABLE_RELEASE); } +/* Unicast Server Performs Client-Initiated Release Operation + * + * Test Purpose: + * Verify the behavior of a Unicast Server IUT when a Unicast Client initiates + * a Release operation. + * + */ +static void test_usr_scc_release(void) +{ + define_test("BAP/USR/SCC/BV-143-C [USR SRC Release in Codec Configured" + " state]", + test_setup_server, test_server, &cfg_src_cc_release, + SCC_SRC_CC_RELEASE); + define_test("BAP/USR/SCC/BV-144-C [USR SNK Release in Codec Configured" + " state]", + test_setup_server, test_server, &cfg_snk_cc_release, + SCC_SNK_CC_RELEASE); + define_test("BAP/USR/SCC/BV-145-C [USR SRC Release in QoS Configured" + " state]", + test_setup_server, test_server, &cfg_src_qos_release, + SCC_SRC_QOS_RELEASE); + define_test("BAP/USR/SCC/BV-146-C [USR SNK Release in QoS Configured" + " state]", + test_setup_server, test_server, &cfg_snk_qos_release, + SCC_SNK_QOS_RELEASE); + define_test("BAP/USR/SCC/BV-147-C [USR SRC Release in Enabling state]", + test_setup_server, test_server, &cfg_src_enable_release, + SCC_SRC_ENABLE_RELEASE); + define_test("BAP/USR/SCC/BV-148-C [USR SNK Release in Enabling or" + " Streaming state]", + test_setup_server, test_server, &cfg_snk_enable_release, + SCC_SNK_ENABLE_RELEASE); + define_test("BAP/USR/SCC/BV-149-C [USR SRC Release in Streaming state]", + test_setup_server, test_server, &cfg_src_start_release, + SCC_SRC_START_RELEASE); + define_test("BAP/USR/SCC/BV-150-C [USR SRC Release in Disabling state]", + test_setup_server, test_server, + &cfg_src_disable_release, SCC_SRC_DISABLE_RELEASE); +} + +static void test_scc_release(void) +{ + test_ucl_scc_release(); + test_usr_scc_release(); +} + static void bap_metadata(struct bt_bap_stream *stream, uint8_t code, uint8_t reason, void *user_data) From patchwork Fri Apr 4 19:39:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878637 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5115A221550 for ; Fri, 4 Apr 2025 19:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795626; cv=none; b=GAPu6OEybRUborhLWl+nlSqEZ8edJbYL82gZrhhMmY3YxzjEU4jYtLJtYruDlf7prmWDjI5Q0Gvmml7b1aG6kYAM9pF5LbFdij1KLaUosOUMVwalMbuiglqrTkdsrLtzvBVC87+RT4mRbwGD2Jd79lWjyU6RHkKgHO9pZ8rwzB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795626; c=relaxed/simple; bh=cmC7hky2Vn+LUZjmB6afbYjb8teibBXf7df+BoGBptQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O7yk0lslhC+r/kBfmzgxVPNOB/Xcu3TrUdhECeVogGnlMRLQPK3nbW96IZnCh7iO03IjBmISS/DuOBocsmbLe0tzC246x10CKTcXEwKo8IAFr0u16G7TKYmrcixou7oF5j7YG2Tf59IBkTt6/Dn7cYUJJ0BYHrqWVAmrIolS+bA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Sdyyf0d2; arc=none smtp.client-ip=209.85.222.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Sdyyf0d2" Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-86d587dbc15so2120707241.1 for ; Fri, 04 Apr 2025 12:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795622; x=1744400422; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WqlP6RFd3tIMU3a40inzv1GaWZAnR1PRLKpi+ND6FDM=; b=Sdyyf0d2/bom2t8tCCO4cjo0dZ2FVDTnBfSX1SskcvYfVSGcKzIiXmSxVRjsl52/h7 m0uBhqexQYYVx8D5i92+UeRGpTv0xgnhoeokWkQyut6YpluEJiamudtr9h7gTrFDmjPg X6rvMoBMYYGo/AGarbOTiVcX5hz+nsrSisVk8yDfMTwBXQNcsr10dQp0MwyZegkDESWr s1/jxT2eqx7x3/eIiM1k3Or6O7m5jd7mxlTsmlA/ztV2XJqQYePeyCISN2rge36/Q379 62LM/Z67/BDPRRMexDoOtUMLR3z1iD0PGGI0XTddUJYP1Bgdu8eSS/NUzDQ2W5Mx7Aav Dd9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795622; x=1744400422; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WqlP6RFd3tIMU3a40inzv1GaWZAnR1PRLKpi+ND6FDM=; b=Si4vLx1gtvAfqkMDOZPCY8iNNZgir/+LiIV3S5t5ZdR19ZjWIV2E2PY5JVSCOdiVEk /Ka3JfpdPEacBs3X2l5gDQZq5dJZq9xkZkwU9vT5osPD0BxcQIrkgYpHUFGsnPb+8o7R WcG9hHSwa0Cxas3M/v5HXTwlY+5/KreJ51vKVroD5+8FIGhMSuGufvgpAd0CZAyrE4Lr CZyw1dZUvgzZzBJc0g0KWU6MLDsgXp6i61TU/i/K3O3X5hJ6NXWfLXVFON7ABN88EsU1 LOt3j4+MQ8mLWr9JblFQ8+hGptmdJhFXgVyQ3TViYEgCuqKedj75vc1xu6blidI87YOz WITQ== X-Gm-Message-State: AOJu0YzeNOSNoSF1DqGc1jeKrSIyK6z7DMyjuAOhSb9UKsg3Go4piUa5 R4YGHLux2eGHoymmG0GZkFI446LwVV45/872NsyaS0S89VfsSZ7FeHrfC0cJdbA= X-Gm-Gg: ASbGncua9GNeTNn9tuJhQ4/KomRelML+QW/Rr4HO050OZCzDEghFbXPAMS6ARcSW97c E1dnZQya3rWvmFdklgJ7Y84y4s6irnyErNlGl+ZOYSnCEimgsSYhVP7eyy5KiDaO374bcoHyJjw PnfL7ULr4AEr/pw4M0wMaEl07dXR7dgvMFBQHkCebUcNqDtL4f2bkZ7lY1D591FETMegmI83yvX T8l1rM1htq4WvELDISJyNQtqSXN4HwNx2GwUDkPETy2plwwzifGYYENNvhdsTceZG7QaZ+A1/xm nlflZ8BbgYW/J5F75ZwgekC9Iz9oRAvFqBBjIH26dbyIqNeClDf3CYHpnaRuQ+oSIHUwiHSu3Cj kYkLfiJ/FourRrLNXp1iHPZ+7 X-Google-Smtp-Source: AGHT+IHJ9y8m5fgoS6NQMK4FxQu13ku5mP8SU6kA5foDaLoBYCXjgt/88ZfAenlS28bnijWLWpldJg== X-Received: by 2002:a67:f714:0:b0:4c0:435b:5dd2 with SMTP id ada2fe7eead31-4c8459f513fmr6210890137.1.1743795621964; Fri, 04 Apr 2025 12:40:21 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:21 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 10/11] shared/bap: Fix not sending ASE Notication in case of Metadata update Date: Fri, 4 Apr 2025 15:39:48 -0400 Message-ID: <20250404193959.359008-11-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Tests such if metadata update requires the server to generate ASE notification on Update Metadata operation. --- src/shared/bap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index 73d1b6192843..ae840c14ded1 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2148,6 +2148,9 @@ static uint8_t stream_metadata(struct bt_bap_stream *stream, struct iovec *meta, util_iov_free(stream->meta, 1); stream->meta = util_iov_dup(meta, 1); + /* Force state change to the same state to update the metadata */ + stream_set_state(stream, bt_bap_stream_get_state(stream)); + return 0; } From patchwork Fri Apr 4 19:39:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 878284 Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B5C5227EB9 for ; Fri, 4 Apr 2025 19:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795628; cv=none; b=mQRF/Y8JzH/JZVxdUI81opv2xQoGCfvKLXZkLoMjMJJM6XMIm3gw0bYKrzKHJh1MiBSNpEmcJcET1iwqo6ku6XMrtnC1CJ8k3J/dpqTf7OoGeJhF/U4xDGlQ7mW8mKh4q2GPK2ISumUltWOj3TNxt9toCY5YfHnGBiSB4hKOEUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743795628; c=relaxed/simple; bh=CXLxyP410fRpt64ZOOLY4z3YvvSGAudaFdOL6DsKMPo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iAyDEu6Vtwriu3dHTacqvh57kGIU1iVfVBEpy6k2kFPd9XX2IkmnxhffWov5inyVCwe85ixfKvdcIXtqJCrD899B12Ov4WlXQL6vlmPtFKLwp5JydBFaAey+rlEo8fRNW6OM2trZE4JRQdpOUZ+W6mGi8Uo7fm17RJkKI7zXpfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nFgF6FmG; arc=none smtp.client-ip=209.85.222.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nFgF6FmG" Received: by mail-ua1-f49.google.com with SMTP id a1e0cc1a2514c-86b9d1f729eso1128409241.3 for ; Fri, 04 Apr 2025 12:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743795624; x=1744400424; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Q8jttERukblywXwrKsL0Af2/sHwoQGtFPkhNzIFFZIk=; b=nFgF6FmG8XsVNiAMff9iukdOlYWvvIPESZmgqn7noyqTfMpR6C9BHOtFcCMzJn7unj yC0OahDpJZh3Jv7QC4YddMBkF4rPZnTd3ZijZ5anuZcJOz8owz0WzywsEgqgu6nVAyBP 1pP7zzP44IZFOpOYdP3N96Mr5RgFTcfYEoyu+EL1hxXBWONJ/ZyXcSV373JuKN+Ww3sx /GDkIFx5Gmqf4O+K0GthEHjcLKaoWrqtYsWMuDVk+N9l9NU/0Kje2Ex/sS/LVKnX9rEc UAdVCCyMJYGl7SA5W1rxRLbKQFPIFC6N0t0bE/xwAFqRrpJa+25EmW1T4r4TXljaS1qk 6Mtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743795624; x=1744400424; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q8jttERukblywXwrKsL0Af2/sHwoQGtFPkhNzIFFZIk=; b=UPXGb2Cj/Ad4vm9cX+irqScFHl71Ay7YSiALZ7Ks7O1pNIt4wiP0Lc2Q1CXvNS0TXH qwKWc33qH2GGRbh8/eNIJFssAVi0zIleimFQpcCotfFTrpK4h9yuvjFz6n+ml8rszr18 zoQ1vtjCqsiNgCNfCNiEcCG3H8qK8QszLcutmtRRlGHvo6dgbHazHmIiomUzAD7jVa6e O7XmSTp5aozJyZJO3f6UrsYXErHjQEq6NEeLZYCua5VFbn7YNe+cq421BS107ii242oQ xXhjxLK5oXalLvwmRvswyryT6kafI1CtgaA06fe9Bs1w1pXdx3dSilPUxiTADyKSspdS m1Cw== X-Gm-Message-State: AOJu0YzbHgwv/c7RwxwCjz8cKbFdpkFO2+Cm+KZ4LOijTmytBYhdZfyr 4KAfxoww/Qf3zyOLn8ulUGfqrB4fApwhCaAEgsn+jfLG95jaszJ5JaLgf8j7IzQ= X-Gm-Gg: ASbGncuA0+Gy5j54JugdUyiBxBy6cQtRj5tM/J68XWqCX0spQorCJKs3DKV05qGOydB j1c+X8ON73skuam2BHgFNFBIE4ZMhGurBtzROiKc7FG9KZ71syuvvp+LjKX20RyNaZsesxoL4GL uNEeqX+m6QhRiKum74DAJgAI0I4glGo3LJiFdntdHg75ZRdftxCe+0bIR6Lq7um/Yu7++UuOfFN +/lzrEZ+cGphFhGOxDrcfrzOOlcvdIqyiZCMqdfXRrQsm3aVV9dGinaDSWIFmEHI111Wi8NTtjr RX6vRoeVS22L2gehjkM0lAaYUK2wci3whRXQj7IJBwKcXtS6EawDmKzuh713Sorwmf95fPz6Yho 1oTM9x6QGXDGY1A== X-Google-Smtp-Source: AGHT+IGwsOpiFIqmZVVO7XZj2lw0KgBT9Zyy1C4pDxpFGYq/fiQ+QUJ7ix2CAFehHKrP7K2BJG/LmA== X-Received: by 2002:a05:6102:54aa:b0:4c3:7f7:92f4 with SMTP id ada2fe7eead31-4c85539d9c7mr3799750137.6.1743795624183; Fri, 04 Apr 2025 12:40:24 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8738b1d352esm718587241.19.2025.04.04.12.40.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:40:22 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 11/11] test-bap: Introduce USR/SCC Metadata tests for LC3 Date: Fri, 4 Apr 2025 15:39:49 -0400 Message-ID: <20250404193959.359008-12-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404193959.359008-1-luiz.dentz@gmail.com> References: <20250404193959.359008-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Unicast Server Performs Update Metadata Operation Test Purpose: Verify that a Unicast Server IUT can perform an Update Metadata operation initiated by a Unicast Client. Pass verdict: The IUT sends a notification of the ASE Control Point characteristic with Response_Code set to Success (0x00) for the requested ASE_ID and opcode. Test Summary ------------ BAP/USR/SCC/BV-161-C [USR SRC Update Metadata in Enabling State] Passed BAP/USR/SCC/BV-162-C [USR SNK Update Metadata in Enabling or Streaming state] Passed BAP/USR/SCC/BV-163-C [USR SRC Update Metadata in Streaming State] Passed Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0 --- unit/test-bap.c | 56 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index c77fc83d83de..9a07bd8f53e7 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -3734,6 +3734,9 @@ static void test_ucl_scc_release(void) * Verify the behavior of a Unicast Server IUT when a Unicast Client initiates * a Release operation. * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic value. + * */ static void test_usr_scc_release(void) { @@ -3815,15 +3818,13 @@ static struct test_config cfg_snk_metadata = { * Data: 0701010000 * ATT: Handle Value Notification (0x1b) len 37 * Handle: 0x0016 - * Data: 01010102010a00204e00409c00204e00409c00_qos + * Data: 0103000000 */ #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) + IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00) #define SCC_SNK_METADATA \ SCC_SNK_ENABLE, \ @@ -3845,18 +3846,16 @@ static struct test_config cfg_src_metadata = { * Data: 0701030000 * ATT: Handle Value Notification (0x1b) len 37 * Handle: 0x001c - * Data: 030300000403020100 + * Data: 0303000000 */ -#define ASE_SRC_METADATA \ +#define ASE_SRC_METADATA(_state) \ 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) + IOV_DATA(0x1b, 0x1c, 0x00, 0x03, _state, 0x00, 0x00, 0x00) #define SCC_SRC_METADATA \ SCC_SRC_ENABLE, \ - ASE_SRC_METADATA + ASE_SRC_METADATA(0x03) static void state_start_metadata(struct bt_bap_stream *stream, uint8_t old_state, uint8_t new_state, @@ -3886,7 +3885,7 @@ static struct test_config cfg_src_metadata_streaming = { #define SCC_SRC_METADATA_STREAMING \ SCC_SRC_ENABLE, \ SRC_START, \ - ASE_SRC_METADATA + ASE_SRC_METADATA(0x04) /* Unicast Client Initiates Update Metadata Operation * @@ -3898,7 +3897,7 @@ static struct test_config cfg_src_metadata_streaming = { * 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) +static void test_ucl_scc_metadata(void) { define_test("BAP/UCL/SCC/BV-115-C [UCL SNK Update Metadata in Enabling " "State]", @@ -3914,6 +3913,39 @@ static void test_scc_metadata(void) SCC_SRC_METADATA_STREAMING); } +/* Unicast Server Performs Update Metadata Operation + * + * Test Purpose: + * Verify that a Unicast Server IUT can perform an Update Metadata operation + * initiated by a Unicast Client. + * + * Pass verdict: + * The IUT sends a notification of the ASE Control Point characteristic with + * Response_Code set to Success (0x00) for the requested ASE_ID and opcode. + */ +static void test_usr_scc_metadata(void) +{ + define_test("BAP/USR/SCC/BV-161-C [USR SRC Update Metadata in Enabling " + "State]", + test_setup_server, test_server, &cfg_src_metadata, + SCC_SRC_METADATA); + define_test("BAP/USR/SCC/BV-162-C [USR SNK Update Metadata in Enabling " + "or Streaming state]", + test_setup_server, test_server, &cfg_snk_metadata, + SCC_SNK_METADATA); + define_test("BAP/USR/SCC/BV-163-C [USR SRC Update Metadata in Streaming" + " State]", + test_setup_server, test_server, + &cfg_src_metadata_streaming, + SCC_SRC_METADATA_STREAMING); +} + +static void test_scc_metadata(void) +{ + test_ucl_scc_metadata(); + test_usr_scc_metadata(); +} + #define SNK_ENABLE \ IOV_DATA(0x52, 0x22, 0x00, 0x03, 0x01, 0x01, 0x04, 0x03, 0x02, 0x01, \ 00), \