Skip to contentSkip to conversation

test: functional: change the HoG connection rate from the HID device

PATCH In review Luiz Augusto von Dentz 2 participants 3 messages Oct 12 – Oct 27 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 test: functional: change the HoG connection rate from the HID device

From: Luiz Augusto von Dentz <[email protected]>

As specified by the HIDS/HOGP SCI FIPD, the HID device initiates the Connection Rate Update procedure once the HID host writes the mode to the HID Control Point, so load the connection subrate on the HID device instead of the HID host.

This requires the kernel to issue the LE Connection Rate Request as peripheral.

Assisted-by OpenCode:claude-opus-5.5
---
 doc/functional-hog.rst      | 13 ++++++-------
 test/functional/test_hog.py | 21 +++++++++++----------
 2 files changed, 17 insertions(+), 17 deletions(-)
doc/functional-hog.rst +6 -7
index 795a066a6f1a..6d0b0132d5dd 100644
@@ -135,7 +135,7 @@ test_hog[sci]
 	10. host0: ``gatt.select-attribute 2c39`` and ``gatt.notify on``.
 	11. host0: ``gatt.select-attribute 2a4c`` and ``gatt.write "0x03"``,
 	    i.e. Enable SCI Fast mode written to the HID Control Point.
-	12. host0: ``mgmt.conn-subrate <host1 bdaddr> 0x0008 0x0010 1 1 0 0
+	12. host1: ``mgmt.conn-subrate <host0 bdaddr> 0x0008 0x0010 1 1 0 0
 	    0x01f4``, i.e. interval 1 ms to 2 ms, within the range given in
 	    HID SCI Information, no subrating, no latency and 5 s
 	    supervision timeout.
@@ -196,9 +196,8 @@ test_hog[sci]
 	Notify only. The Control Point is written with bluetoothctl, as the
 	input plugin has no D-Bus API to request a mode.
 
-	The HID device is meant to change the connection rate once the
-	mode is written, but the kernel only issues the LE Connection Rate
-	Request as central, so the connection rate is changed by the HID
-	host. This requires
-	the controllers to support Shorter Connection Intervals, which
-	btvirt emulates as a BR/EDR/LE 6.2 controller.
+	The HID device, the peripheral, then changes the connection rate
+	according to the mode, which requires the kernel to issue the LE
+	Connection Rate Request as peripheral, as well as the controllers
+	to support Shorter Connection Intervals, which btvirt emulates as a
+	BR/EDR/LE 6.2 controller.
test/functional/test_hog.py +11 -10
index 7ff0965275d1..a76c91602896 100644
@@ -45,10 +45,10 @@ REPORTS = [
 # HID SCI Mode
 SCI_FAST_MODE = "03"
 
-# LE Connection Rate parameters requested with mgmt.conn-subrate once in
-# SCI Fast Mode: interval 1 ms to 2 ms (units of 0.125 ms), within the
-# range given in HID SCI Information, no subrating, no latency and 5 s
-# supervision timeout (units of 10 ms)
+# LE Connection Rate parameters requested by the HID device with
+# mgmt.conn-subrate once in SCI Fast Mode: interval 1 ms to 2 ms (units of
+# 0.125 ms), within the range given in HID SCI Information, no subrating,
+# no latency and 5 s supervision timeout (units of 10 ms)
 SCI_RATE = ["0x0008", "0x0010", "1", "1", "0", "0", "0x01f4"]
 
 # Reported when an operation cannot complete, so a test does not have to
@@ -251,17 +251,18 @@ def test_hog(hosts, init_script, flags, sci):
     )
     assert expect_hexdump(device) == SCI_FAST_MODE
 
-    # The HID device is meant to change the connection rate, but the kernel
-    # only requests it as central, so the HID host does it instead
-    ctl.send(f"mgmt.conn-subrate {host1.bdaddr} {' '.join(SCI_RATE)}\n")
+    # The HID device then changes the connection rate according to the
+    # mode, see the HIDS/HOGP SCI FIPD, which requires the kernel to issue
+    # the LE Connection Rate Request as peripheral
+    device.send(f"mgmt.conn-subrate {host0.bdaddr} {' '.join(SCI_RATE)}\n")
     # The connection rate may change before the command completes, so the
     # event may be printed before the reply
     rate = rf"{{}} type .* connection subrate interval {SCI_RATE[0]}"
     expect_all(
-        ctl,
-        [r"Connection Subrate loaded successfully", rate.format(host1.bdaddr.upper())],
+        device,
+        [r"Connection Subrate loaded successfully", rate.format(host0.bdaddr.upper())],
     )
-    expect(device, rate.format(host0.bdaddr.upper()))
+    expect(ctl, rate.format(host1.bdaddr.upper()))
 
     # Then the HID device confirms the mode has been changed
     ctl.send("gatt.select-attribute 2c39\n")
Signature · 1 line
2.56.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1184010/

---Test result---

Test Summary:

CheckPatch                    PASS      0.30 seconds
GitLint                       PASS      0.24 seconds
BuildEll                      PASS      17.83 seconds
BluezMake                     PASS      316.85 seconds
MakeCheck                     PASS      13.82 seconds
MakeDistcheck                 PASS      133.02 seconds
CheckValgrind                 PASS      225.89 seconds
CheckSmatch                   PASS      247.31 seconds
bluezmakeextell               PASS      89.05 seconds
TestFunctional                FAIL      1139.47 seconds
IncrementalBuild              PASS      316.62 seconds
ScanBuild                     PASS      1014.36 seconds

Details
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_hog::test_hog[sci-hosts18-vm2]: pytest_bluezenv.rpc.RemoteError: <pexpect.popen_spawn.PopenSpawn object at 0x7f5ee76b67b0>

    searcher: searcher_re:
        0: re.compile(b'(Failed to \\w+[^\\r\\n]*)')
        1: re.compile(b'(Device \\S+ not available)')
        2: re.compile(b'(No device connected)')
        3: re.compile(b'(No attribute selected)')
        4: re.compile(b'00:AA:01:00:00:42 type .* connection subrate interval 0x0008')
    <pexpect.popen_spawn.PopenSpawn object at 0x7f5ee76b67b0>
    searcher: searcher_re:
        0: re.compile(b'(Failed to \\w+[^\\r\\n]*)')
        1: re.compile(b'(Device \\S+ not available)')
        2: re.compile(b'(No device connected)')
        3: re.compile(b'(No attribute selected)')
        4: re.compile(b'00:AA:01:00:00:42 type .* connection subrate interval 0x0008')
    Remote traceback:
        Traceback (most recent call last):
          File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/rpc.py", line 102, in server_stream
            result = method(*msg["a"], **msg["kw"])
          File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/env.py", line 256, in call_plugin
            return getattr(self.plugins[name], method)(*a, **kw)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
          File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/host_plugins.py", line 441, in expect
            ret = ctl.expect(*a, **kw)
          File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 354, in expect
            return self.expect_list(compiled_pattern_list,
                   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
                    timeout, searchwindowsize, async_)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 383, in expect_list
            return exp.expect_loop(timeout)
                   ~~~~~~~~~~~~~~~^^^^^^^^^
          File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 181, in expect_loop
            return self.timeout(e)
                   ~~~~~~~~~~~~^^^
          File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 144, in timeout
            raise exc
        pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f5ee76b67b0>
        searcher: searcher_re:
            0: re.compile(b'(Failed to \\w+[^\\r\\n]*)')
            1: re.compile(b'(Device \\S+ not available)')
            2: re.compile(b'(No device connected)')
            3: re.compile(b'(No attribute selected)')
            4: re.compile(b'00:AA:01:00:00:42 type .* connection subrate interval 0x0008')
        <pexpect.popen_spawn.PopenSpawn object at 0x7f5ee76b67b0>
        searcher: searcher_re:
            0: re.compile(b'(Failed to \\w+[^\\r\\n]*)')
            1: re.compile(b'(Device \\S+ not available)')
            2: re.compile(b'(No device connected)')
            3: re.compile(b'(No attribute selected)')
            4: re.compile(b'00:AA:01:00:00:42 type .* connection subrate interval 0x0008')

https://github.com/bluez/bluez/pull/2663

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz

This is an automated email and please do not reply to this email.

Dear Submitter,

This series was picked up by the CI more than 2 weeks ago and the pull request created for it is still open, which means the series was never applied to the tree.

Series: [BlueZ,v1] test: functional: change the HoG connection rate from the HID device
Pull Request: https://github.com/bluez/bluez/pull/2663
Created: 2026-10-12 17:51:17+00:00

The pull request has been closed and no further action is taken on this series.

If the change should still be considered, it must be resent to the Linux Bluetooth mailing list ([email protected]) so that it is picked up again.

---
Regards,
Linux Bluetooth