Linux bluetooth development
 help / color / mirror / Atom feed
From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>
Subject: [PATCH BlueZ 2/2] unit/test-bap: Add test for an unknown ASE CP opcode
Date: Tue, 24 Nov 2026 14:31:12 +0100	[thread overview]
Message-ID: <20261124133112.3956249-2-simon.mikuda@streamunlimited.com> (raw)
In-Reply-To: <20261124133112.3956249-1-simon.mikuda@streamunlimited.com>

Write an unknown opcode to the ASE Control Point with a Write Request
and expect the Unsupported Opcode notification and a Write Response.

Assisted-by: Claude:claude-opus-5-5
---
 unit/test-bap.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/unit/test-bap.c b/unit/test-bap.c
index bfe98a885..7c5f94d86 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -4624,6 +4624,26 @@ static void test_scc_metadata(void)
 	IOV_DATA(0x52, CP_HND, _op, 0x00), \
 	ASE_CP_RSP_TRUNCATED(_op)
 
+/* ATT: Write Request (0x12) len 5
+ *   Handle: 0x0022 Type: ASE Control Point (0x2bc6)
+ *     Data: 0f0101
+ * ATT: Write Response (0x13) len 0
+ * ATT: Handle Value Notification (0x1b) len 7
+ *   Handle: 0x0022 Type: ASE Control Point (0x2bc6)
+ *     Data: 0fff000100
+ *       Opcode: Unknown (0x0f)
+ *       Number of ASE(s): 255
+ *       ASE: #0
+ *       ASE ID: 0x00
+ *       ASE Response Code: Unsupported Opcode (0x01)
+ *       ASE Response Reason: None (0x00)
+ */
+#define SPE_CP_UNSUPPORTED(_op) \
+	IOV_DATA(0x12, CP_HND, _op, 0x01, 0x01), \
+	IOV_DATA(0x13), \
+	IOV_NULL, \
+	IOV_DATA(0x1b, CP_HND, _op, 0xff, 0x00, 0x01, 0x00)
+
 #define SPE_METADATA_TRUNCATED(_ase) \
 	IOV_DATA(0x52, CP_HND, 0x07, 0x01, _ase), \
 	ASE_CP_RSP_TRUNCATED(0x07)
@@ -4657,6 +4677,10 @@ static void test_usr_spe(void)
 	define_test("BAP/USR/SPE/BI-02-C [USR ASE Control Point zero ASEs]",
 			test_setup_server, test_server, NULL,
 			SPE_CP_ZERO_ASES(0x03));
+	define_test("BAP/USR/SPE/BLUEZ-1 [USR ASE Control Point unsupported "
+			"opcode]",
+			test_setup_server, test_server, NULL,
+			SPE_CP_UNSUPPORTED(0x0f));
 	define_test("BAP/USR/SPE/BI-03-C [USR Update Metadata truncated]",
 			test_setup_server, test_server, NULL,
 			SPE_METADATA_TRUNCATED(SRC_ID(0)));
-- 
2.43.0


  reply	other threads:[~2026-11-24 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 13:31 [PATCH BlueZ 1/2] shared/bap: Don't fail an ASE CP write with an unknown opcode Simon Mikuda
2026-11-24 13:31 ` Simon Mikuda [this message]
2026-11-24 20:38 ` [BlueZ,1/2] " bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124133112.3956249-2-simon.mikuda@streamunlimited.com \
    --to=simon.mikuda@streamunlimited.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox