From 2fa8075fb0dbcbd34d92693e77719b2658d1c986 Mon Sep 17 00:00:00 2001 From: Wojciech Pietraszewski Date: Wed, 2 Oct 2024 18:47:31 +0200 Subject: [PATCH] examples/run_cig_setup: Fix the address type and CIG params Changes the address type used during connecting to what is actually advertised by Device 0 by default (random address). Amends CIG Parameters to use values allowed by the Core specification. Updates the usage of the script and the example that show when executed incorrectly. --- examples/run_cig_setup.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/run_cig_setup.py b/examples/run_cig_setup.py index 29a54ad..b0a0fe1 100644 --- a/examples/run_cig_setup.py +++ b/examples/run_cig_setup.py @@ -36,13 +36,10 @@ from bumble.transport import open_transport_or_link async def main() -> None: if len(sys.argv) < 3: print( - 'Usage: run_cig_setup.py ' + 'Usage: run_cig_setup.py ' ' ' ) - print( - 'example: run_cig_setup.py device1.json' - 'tcp-client:127.0.0.1:6402 tcp-client:127.0.0.1:6402' - ) + print('example: run_cig_setup.py device1.json hci-socket:0 hci-socket:1') return print('<<< connecting to HCI...') @@ -65,18 +62,18 @@ async def main() -> None: advertising_set = await devices[0].create_advertising_set() connection = await devices[1].connect( - devices[0].public_address, own_address_type=OwnAddressType.PUBLIC + devices[0].random_address, own_address_type=OwnAddressType.RANDOM ) cid_ids = [2, 3] cis_handles = await devices[1].setup_cig( cig_id=1, cis_id=cid_ids, - sdu_interval=(10000, 0), + sdu_interval=(10000, 255), framing=0, max_sdu=(120, 0), retransmission_number=13, - max_transport_latency=(100, 0), + max_transport_latency=(100, 5), ) def on_cis_request(