Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 12/12] l2cap-tester: Add SCI mode tests for LE server connections
Date: Fri, 24 Jul 2026 15:12:25 -0400	[thread overview]
Message-ID: <20260724191225.1815634-13-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20260724191225.1815634-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Add L2CAP LE server connection tests that exercise the peripheral
side of the Shorter Connection Interval feature. The emulated client
(central) is configured via bthost_le_conn_rate() to send an LE
Connection Rate Request once connected, using the HOGP v1.2
recommended values for each of the four HID SCI modes (Fast, Default,
Low Power, Full Range).
---
 tools/l2cap-tester.c | 51 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index 88bfd71bf580..3011a811e15e 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -740,6 +740,26 @@ static const struct l2cap_data le_client_connect_subrate_full_range_test = {
 	.conn_subrate = &conn_subrate_hids_full_range,
 };
 
+static const struct l2cap_data le_server_subrate_fast_test = {
+	.cid = 0x0004,
+	.conn_subrate = &conn_subrate_hids_fast,
+};
+
+static const struct l2cap_data le_server_subrate_default_test = {
+	.cid = 0x0004,
+	.conn_subrate = &conn_subrate_hids_default,
+};
+
+static const struct l2cap_data le_server_subrate_low_power_test = {
+	.cid = 0x0004,
+	.conn_subrate = &conn_subrate_hids_low_power,
+};
+
+static const struct l2cap_data le_server_subrate_full_range_test = {
+	.cid = 0x0004,
+	.conn_subrate = &conn_subrate_hids_full_range,
+};
+
 static const struct l2cap_data le_client_connect_close_test_1 = {
 	.client_psm = 0x0080,
 };
@@ -2963,6 +2983,24 @@ static void send_req_new_conn(uint16_t handle, void *user_data)
 
 	data->handle = handle;
 
+	if (l2data->conn_subrate) {
+		const struct l2cap_conn_subrate *cs = l2data->conn_subrate;
+		struct bthost_conn_rate rate;
+
+		rate.interval_min = cs->min_interval;
+		rate.interval_max = cs->max_interval;
+		rate.subrate_min = cs->subrate_min;
+		rate.subrate_max = cs->subrate_max;
+		rate.max_latency = cs->max_latency;
+		rate.cont_num = cs->cont_num;
+		rate.supv_timeout = cs->supv_timeout;
+
+		tester_print("Sending LE Connection Rate Request from client");
+
+		bthost = hciemu_client_get_host(data->hciemu);
+		bthost_le_conn_rate(bthost, handle, &rate);
+	}
+
 	if (l2data->send_cmd) {
 		bthost_l2cap_rsp_cb cb;
 
@@ -3248,6 +3286,19 @@ int main(int argc, char *argv[])
 	test_l2cap_le_62("L2CAP LE Client - SCI Full Range Mode",
 				&le_client_connect_subrate_full_range_test,
 				setup_powered_client, test_connect);
+
+	test_l2cap_le_62("L2CAP LE Server - SCI Fast Mode",
+				&le_server_subrate_fast_test,
+				setup_powered_server, test_server);
+	test_l2cap_le_62("L2CAP LE Server - SCI Default Mode",
+				&le_server_subrate_default_test,
+				setup_powered_server, test_server);
+	test_l2cap_le_62("L2CAP LE Server - SCI Low Power Mode",
+				&le_server_subrate_low_power_test,
+				setup_powered_server, test_server);
+	test_l2cap_le_62("L2CAP LE Server - SCI Full Range Mode",
+				&le_server_subrate_full_range_test,
+				setup_powered_server, test_server);
 	test_l2cap_le("L2CAP LE Client - Close",
 				&le_client_connect_close_test_1,
 				setup_powered_client, test_connect_close);
-- 
2.54.0


      parent reply	other threads:[~2026-07-24 19:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 19:12 [PATCH BlueZ v1 00/12] Add support for Shorter Connection Interval (SCI) Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 01/12] input/hog-lib: Add discovery support for HIDS 1.1 SCI attributes Luiz Augusto von Dentz
2026-07-24 20:41   ` Add support for Shorter Connection Interval (SCI) bluez.test.bot
2026-07-24 19:12 ` [PATCH BlueZ v1 02/12] emulator/btdev: Add emulation support for HIDS 1.1 SCI commands Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 03/12] mgmt: Add Shorter Connection Interval setting and Load Connection Subrate Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 04/12] mgmt-tester: Add tests for SCI " Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 05/12] adapter: Add support for loading connection subrate parameters Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 06/12] monitor: Add decoding for Load Connection Subrate, SCI setting and event Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 07/12] doc: Document ConnectionSubrate storage format Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 08/12] client/mgmt: Add conn-subrate command Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 09/12] mgmt-tester: Add HIDS recommended SCI parameter tests Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 10/12] l2cap-tester: Add SCI mode tests for LE client connections Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 11/12] emulator/bthost: Add LE Connection Rate Request support Luiz Augusto von Dentz
2026-07-24 19:12 ` Luiz Augusto von Dentz [this message]

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=20260724191225.1815634-13-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.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