Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/3] emulator: bthost: add function for sending raw L2CAP sig commands
@ 2026-08-30 19:57 Pauli Virtanen
  2026-08-30 19:57 ` [PATCH BlueZ v2 2/3] tools/l2cap-server: add test for invalid Conn Req on Ext-Flowctl server Pauli Virtanen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pauli Virtanen @ 2026-08-30 19:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add bthost_l2cap_sig_raw() that tests can use to send raw L2CAP
signaling commands.
---

Notes:
    v2:
    - no changes

 emulator/bthost.c | 13 +++++++++++++
 emulator/bthost.h |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 46c6a52f5..b3d48ffb3 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -811,6 +811,19 @@ static uint8_t l2cap_sig_send(struct bthost *bthost, struct btconn *conn,
 	return ident;
 }
 
+uint8_t bthost_l2cap_sig_raw(struct bthost *bthost, uint16_t handle,
+					uint8_t code, uint8_t ident,
+					const void *data, uint16_t len)
+{
+	struct btconn *conn;
+
+	conn = bthost_find_conn(bthost, handle);
+	if (!conn)
+		return 0;
+
+	return l2cap_sig_send(bthost, conn, code, ident, data, len);
+}
+
 void bthost_add_cid_hook(struct bthost *bthost, uint16_t handle, uint16_t cid,
 				bthost_cid_hook_func_t func, void *user_data)
 {
diff --git a/emulator/bthost.h b/emulator/bthost.h
index e104e68af..ed924eb99 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -126,6 +126,10 @@ bool bthost_l2cap_req(struct bthost *bthost, uint16_t handle, uint8_t req,
 				const void *data, uint16_t len,
 				bthost_l2cap_rsp_cb cb, void *user_data);
 
+uint8_t bthost_l2cap_sig_raw(struct bthost *bthost, uint16_t handle,
+						uint8_t req, uint8_t ident,
+						const void *data, uint16_t len);
+
 void bthost_write_scan_enable(struct bthost *bthost, uint8_t scan);
 
 void bthost_set_adv_data(struct bthost *bthost, const uint8_t *data,
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-31 17:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30 19:57 [PATCH BlueZ v2 1/3] emulator: bthost: add function for sending raw L2CAP sig commands Pauli Virtanen
2026-08-30 19:57 ` [PATCH BlueZ v2 2/3] tools/l2cap-server: add test for invalid Conn Req on Ext-Flowctl server Pauli Virtanen
2026-08-30 19:57 ` [PATCH BlueZ v2 3/3] tools/l2cap-tester: test closing sockets with ECRED defer Pauli Virtanen
2026-08-30 21:59 ` [BlueZ,v2,1/3] emulator: bthost: add function for sending raw L2CAP sig commands bluez.test.bot
2026-08-31 17:30 ` [PATCH BlueZ v2 1/3] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox