bluez/client
Iulia Tanasescu 3075a9c17d client/player: Add support to select multiple transports
This updates transport select to link transports together before calling
the "Select" method for each of them.

The bluetoothctl log below shows a Broadcast Sink detecting
2 streams from a source and selecting both of them. After the
first transport is acquired, the link is created and the first
transport goes active.

client/bluetoothctl
[bluetooth]# endpoint.register 00001851-0000-1000-8000-00805f9b34fb 0x06
[/local/endpoint/ep0] Auto Accept (yes/no): y
[/local/endpoint/ep0] Max Transports (auto/value): a
[/local/endpoint/ep0] Locations: 1
[/local/endpoint/ep0] Supported Context (value): 1
Capabilities:
  03 01 ff 00 02 02 03 05 04 1a 00 f0 00 02 03 01
Metadata:
[bluetooth]# Endpoint /local/endpoint/ep0 registered
[bluetooth]# scan on
[bluetooth]# [NEW] Device 17:7A:80:64:A7:93 17-7A-80-64-A7-93
[17-7A-80-64-A7-93]# [NEW] Transport
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0
[17-7A-80-64-A7-93]# [NEW] Transport
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1
[17-7A-80-64-A7-93]# transport.select
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1
[17-7A-80-64-A7-93]# [CHG] Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 State: broadcasting
[17-7A-80-64-A7-93]# [CHG] Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 State: broadcasting
[17-7A-80-64-A7-93]# transport.acquire
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0
[17-7A-80-64-A7-93]# [CHG] Transport
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0
                Links: /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1
[17-7A-80-64-A7-93]# Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 acquiring complete
[17-7A-80-64-A7-93]# Acquire successful: fd 8 MTU 40:0
[17-7A-80-64-A7-93]# [CHG] Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 State: active

The btmon log shows that sync has been established with both BISes:

< HCI Command: LE Broadcast Isochronous Group Create Sync (0x08|0x006b)
        BIG Handle: 0x00
        BIG Sync Handle: 0x0000
        Encryption: Unencrypted (0x00)
        Broadcast Code[16]: 00000000000000000000000000000000
        Maximum Number Subevents: 0x00
        Timeout: 20000 ms (0x07d0)
        Number of BIS: 2
        BIS ID: 0x01
        BIS ID: 0x02
> HCI Event: Command Status (0x0f) plen 4
      LE Broadcast Isochronous Group Create Sync (0x08|0x006b) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19
      LE Broadcast Isochronous Group Sync Estabilished (0x1d)
        Status: Success (0x00)
        BIG Handle: 0x00
        Transport Latency: 0 us (0x000000)
        NSE: 3
        BN: 1
        PTO: 1
        IRC: 3
        Maximum PDU: 40
        ISO Interval: 10.00 msec (0x0008)
        Connection Handle #0: 6
        Connection Handle #1: 7
< HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13
        Handle: 6
        Data Path Direction: Output (Controller to Host) (0x01)
        Data Path: HCI (0x00)
        Coding Format: Transparent (0x03)
        Company Codec ID: Ericsson Technology Licensing (0)
        Vendor Codec ID: 0
        Controller Delay: 0 us (0x000000)
        Codec Configuration Length: 0
        Codec Configuration[0]:
> HCI Event: Command Complete (0x0e) plen 6
      LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
        Status: Success (0x00)
        Handle: 6
< HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13
        Handle: 7
        Data Path Direction: Output (Controller to Host) (0x01)
        Data Path: HCI (0x00)
        Coding Format: Transparent (0x03)
        Company Codec ID: Ericsson Technology Licensing (0)
        Vendor Codec ID: 0
        Controller Delay: 0 us (0x000000)
        Codec Configuration Length: 0
        Codec Configuration[0]:
> HCI Event: Command Complete (0x0e) plen 6
      LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
        Status: Success (0x00)
        Handle: 7

The second transport can then be acquired and it will go straight
to active, since the fd has already been set:

[17-7A-80-64-A7-93]# transport.acquire
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1
[17-7A-80-64-A7-93]# [CHG] Transport
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1
                Links: /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0
[17-7A-80-64-A7-93]# Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 acquiring complete
[17-7A-80-64-A7-93]# Acquire successful: fd 9 MTU 40:0
[17-7A-80-64-A7-93]# [CHG] Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 State: active

The transports can them be released one by one:

[17-7A-80-64-A7-93]# transport.release
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0
[17-7A-80-64-A7-93]# Transport fd disconnected
[17-7A-80-64-A7-93]# [CHG] Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 State: idle
[17-7A-80-64-A7-93]# Release successful
[17-7A-80-64-A7-93]# transport.release
                /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1
[17-7A-80-64-A7-93]# Transport fd disconnected
[17-7A-80-64-A7-93]# [CHG] Transport
    /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 State: idle
[17-7A-80-64-A7-93]# Release successful
2024-10-25 11:36:51 -04:00
..
scripts client: Update scripts to include encrypted stream scenario 2024-10-15 10:55:24 -04:00
admin.c client: Move admin submenu 2022-08-15 16:28:14 -07:00
admin.h client: Move admin submenu 2022-08-15 16:28:14 -07:00
adv_monitor.c client/adv_monitor: Remove shell quit from adv_monitor_register_app 2024-03-08 11:11:49 -05:00
adv_monitor.h bluetoothctl: advmon rssi support for mgmt 2021-01-15 11:55:06 -08:00
advertising.c Fix discoverable property not emitted on updating value to false 2024-07-08 11:51:41 -04:00
advertising.h client/advertising: Add support for advertise.rsi command 2023-04-05 17:00:00 -07:00
agent.c mgmt: Fix crash after pair command 2024-01-03 15:59:23 -05:00
agent.h client: Add SPDX License Identifier 2020-09-21 16:19:33 -07:00
assistant.c client/assistant: Enter Broadcast Code as string 2024-09-09 12:58:05 -04:00
assistant.h client: Add assistant submenu 2024-07-18 14:22:44 -04:00
bluetoothctl-admin.rst client: Add bluetoothctl-admin.1 man page 2023-11-13 14:33:47 -05:00
bluetoothctl-advertise.rst client: Add bluetoothctl-advertise.1 man page 2023-11-14 10:56:57 -05:00
bluetoothctl-assistant.rst bluetoothctl-assistant.1: Update push command example 2024-09-09 12:59:51 -04:00
bluetoothctl-endpoint.rst client: Update endpoint.show and transport.show documentation 2024-09-30 15:43:56 -04:00
bluetoothctl-gatt.rst client: Add bluetoothctl-gatt.1 man page 2023-11-14 12:37:53 -05:00
bluetoothctl-mgmt.rst client: Add bluetoothctl-mgmt.1 man page 2023-07-20 11:14:31 -07:00
bluetoothctl-monitor.rst client: Add bluetoothctl-monitor.1 man page 2023-07-20 11:14:42 -07:00
bluetoothctl-player.rst client: Add bluetoothctl-player.1 man page 2023-11-14 13:04:22 -05:00
bluetoothctl-scan.rst client: Add bluetoothctl-scan.1 man page 2023-11-14 13:21:44 -05:00
bluetoothctl-transport.rst client: Update endpoint.show and transport.show documentation 2024-09-30 15:43:56 -04:00
bluetoothctl.rst client: Add bluetoothctl-assistant.1 man page 2024-08-20 11:20:25 -04:00
display.c client: Add SPDX License Identifier 2020-09-21 16:19:33 -07:00
display.h client: Add SPDX License Identifier 2020-09-21 16:19:33 -07:00
gatt.c client/gatt: Set handle before calling print functions 2024-08-01 04:25:27 -04:00
gatt.h client: Allow gatt.select-attribute to work with local attributes 2022-12-06 13:01:28 -08:00
main.c shared/shell: Fix not handling prompt with color properly 2024-10-17 10:00:02 -04:00
mgmt.c shared/shell: Fix not handling prompt with color properly 2024-10-17 10:00:02 -04:00
mgmt.h client: Add support for mgmt submenu 2023-07-14 15:14:02 -07:00
player.c client/player: Add support to select multiple transports 2024-10-25 11:36:51 -04:00
player.h client: Add support for player submenu 2022-03-30 12:54:29 -07:00
print.c client/print: Add decoding for UUID properties 2024-09-18 15:26:18 -04:00
print.h client/print: Add decoding for UUID properties 2024-09-18 15:26:18 -04:00