Support LE Subrating

This commit is contained in:
khsiao-google
2025-07-31 02:52:42 +00:00
parent 1a81c5d05c
commit 982aaeabc3
5 changed files with 160 additions and 0 deletions
+31
View File
@@ -611,6 +611,37 @@ async def test_enter_and_exit_sniff_mode():
assert devices.connections[0].classic_interval == 2
# -----------------------------------------------------------------------------
@pytest.mark.asyncio
async def test_le_request_subrate():
devices = TwoDevices()
await devices.setup_connection()
q = asyncio.Queue()
def on_le_subrate_change():
q.put_nowait(lambda: None)
devices.connections[0].on(Connection.EVENT_LE_SUBRATE_CHANGE, on_le_subrate_change)
await devices[0].send_command(
hci.HCI_LE_Subrate_Request_Command(
connection_handle=devices.connections[0].handle,
subrate_min=2,
subrate_max=2,
max_latency=2,
continuation_number=1,
supervision_timeout=2,
)
)
await asyncio.wait_for(q.get(), _TIMEOUT)
assert devices.connections[0].parameters.subrate_factor == 2
assert devices.connections[0].parameters.peripheral_latency == 2
assert devices.connections[0].parameters.continuation_number == 1
assert devices.connections[0].parameters.supervision_timeout == 20
# -----------------------------------------------------------------------------
@pytest.mark.asyncio
async def test_power_on_default_static_address_should_not_be_any():