Skip to content

Commit

Permalink
Merge pull request #569 from wpiet/cig-example-fix
Browse files Browse the repository at this point in the history
examples/run_cig_setup: Fix the address type and CIG params
  • Loading branch information
zxzxwu authored Oct 5, 2024
2 parents 566ca13 + e16be1a commit db723a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/mkdocs/src/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ An app that implements a virtual Bluetooth speaker that can receive audio.
## `run_advertiser.py`
An app that runs a simple device that just advertises (BLE).

## `run_cig_setup.py`
An app that creates a simple CIG containing two CISes. **Note**: If using the example config file (e.g. `device1.json`), the `address` needs to be removed, so that the devices are given different random addresses.

## `run_classic_connect.py`
An app that connects to a Bluetooth Classic device and prints its services.

Expand Down
13 changes: 5 additions & 8 deletions examples/run_cig_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@
async def main() -> None:
if len(sys.argv) < 3:
print(
'Usage: run_cig_setup.py <config-file>'
'Usage: run_cig_setup.py <config-file> '
'<transport-spec-for-device-1> <transport-spec-for-device-2>'
)
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...')
Expand All @@ -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(
Expand Down

0 comments on commit db723a5

Please sign in to comment.