Refactor LE emulation with LL and Air Interface

This commit is contained in:
Josh Wu
2025-11-27 21:40:43 +08:00
parent d2a4c2a8e4
commit a84f0279b1
8 changed files with 731 additions and 656 deletions

View File

@@ -35,7 +35,7 @@ from bumble.smp import (
OobLegacyContext,
)
from .test_utils import TwoDevices
from .test_utils import TwoDevices, async_barrier
# -----------------------------------------------------------------------------
# Logging
@@ -56,12 +56,14 @@ async def test_self_disconnection():
two_devices = TwoDevices()
await two_devices.setup_connection()
await two_devices.connections[0].disconnect()
await async_barrier()
assert two_devices.connections[0] is None
assert two_devices.connections[1] is None
two_devices = TwoDevices()
await two_devices.setup_connection()
await two_devices.connections[1].disconnect()
await async_barrier()
assert two_devices.connections[0] is None
assert two_devices.connections[1] is None
@@ -80,7 +82,8 @@ async def test_self_classic_connection(responder_role):
two_devices.devices[1].classic_enabled = True
# Start
await two_devices.setup_connection()
for dev in two_devices.devices:
await dev.power_on()
# Connect the two devices
await asyncio.gather(
@@ -418,8 +421,9 @@ async def test_self_smp_over_classic():
two_devices.devices[1].classic_enabled = True
# Connect the two devices
await two_devices.devices[0].power_on()
await two_devices.devices[1].power_on()
for dev in two_devices.devices:
await dev.power_on()
await asyncio.gather(
two_devices.devices[0].connect(
two_devices.devices[1].public_address, transport=PhysicalTransport.BR_EDR