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
Colors use escape sequence that needs to be enveloped with
RL_PROMPT_START_IGNORE (\001) and RL_PROMPT_END_IGNORE (\002) in order
for readline to properly calculate the prompt length.
Fixes: https://github.com/bluez/bluez/issues/965
A Broadcast Sink might scan encrypted streams, and the user might not
know the Broadcast Code to decrypt them.
This commit adds the option to set an empty Broadcast Code when prompted
for it after transport.select, if the Code is unknown. In this case, if
the Broadcast Sink is acting as a Scan Delegator, it can ask its peer
Broadcast Assistants to provide the Code through BASS.
This adds sample bluetoothctl scripts for the Broadcast
Assistant/Scan Delegator scenarios.
A test setup can be created using these 2 scripts and the
broadcast-source.bt script: The Broadcast Assistant connects
to the Scan Delegator and sends information about a broadcast
stream.
This makes transport.show arguments optional and in case none is given
print all configured transports:
[bluetooth]# transport.show
Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/sep4/fd0
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
Codec: 0x02 (2)
Media Codec: MPEG24
Object Types: MPEG-2 AAC LC
Frequencies: 48kHz
Channels: 2
Bitrate: 320000
VBR: Yes
Device: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX
State: active
Delay: 0x06a4 (1700)
Volume: 0x0059 (89)
Endpoint: /org/bluez/hci0/dev_94_XX_XX_XX_XX_XX/sep4
This adds proper decoding for UUID properties with usage of
bt_uuidstr_to_str so it can print the 'friendly' name as bellow:
bluetoothctl# transport.show /org/bluez/hci0/dev_94_DB_56_F7_F2_88/sep4/fd0
Transport /org/bluez/hci0/dev_94_DB_56_F7_F2_88/sep4/fd0
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
...
This makes command discoverable to print a warning if
discoverable-timeout is not set(0):
[bluetooth]# discoverable-timeout 0
[bluetooth]# Changing discoverable-timeout 0 succeeded
[bluetooth]# [CHG] Controller 4C:49:6C:44:F5:E7 DiscoverableTimeout: 0x00000000 (0)
[bluetooth]# discoverable on
Warning: setting discoverable while discoverable-timeout not set(0) is not recommended
Currently, the user sets the Broadcast Code as an array of bytes
when prompted from the assistant submenu. However, the Bluetooth
Core Specification requires that, on the UI level, the Broadcast
Code shall be represented as a string (Vol 3, Part C, 3.2.6).
This commit makes the Broadcast Code be parsed as a string from
the assistant prompt. The bluetoothctl log below shows a Broadcast
Assistant pushing an encrypted stream to a peer:
client/bluetoothctl
[bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes
[bluetooth]# AdvertisementMonitor path registered
[bluetooth]# scan on
[bluetooth]# [NEW] Device 00:60:37:31:7E:3F 00-60-37-31-7E-3F
[bluetooth]# connect 00:60:37:31:7E:3F
Attempting to connect to 00:60:37:31:7E:3F
[CHG] Device 00:60:37:31:7E:3F Connected: yes
[00-60-37-31-7E-3F]# Connection successful
[00-60-37-31-7E-3F]# [NEW] Device 19:9A:7A:71:E5:8B 19-9A-7A-71-E5-8B
[00-60-37-31-7E-3F]# [NEW] Assistant
/org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1
[00-60-37-31-7E-3F]# assistant.push
/org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1
[Assistant] Enter Metadata (auto/value): a
[Assistant] Enter Broadcast Code (auto/value): Borne House
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1
State: pending
[00-60-37-31-7E-3F]# Assistant
/org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1
pushed
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1
State: requesting
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1
State: active
The btmon log below shows the way the Broadcast Code string is converted
into a byte array and sent to the peer via GATT:
bluetoothd[6013]: < ACL Data TX: Handle 0 flags 0x00 dlen 28
ATT: Write Command (0x52) len 23
Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7)
Data[21]: 02018be5717a9a1900db5e3a02ffff010100000000
Opcode: Add Source (0x02)
Source_Address_Type: 1
Source_Address: 19:9A:7A:71:E5:8B
Source_Adv_SID: 0
Broadcast_ID: 0x3a5edb
PA_Sync_State: Synchronize to PA - PAST not available
PA_Interval: 0xffff
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000001
> ACL Data RX: Handle 0 flags 0x01 dlen 2
ATT: Handle Multiple Value Notification (0x23) len 24
Length: 0x0014
Handle: 0x003a Type: Broadcast Receive State (0x2bc8)
Data[20]: 01018be5717a9a1900db5e3a0201010000000000
Source_ID: 1
Source_Address_Type: 1
Source_Address: 19:9A:7A:71:E5:8B
Source_Adv_SID: 0
Broadcast_ID: 0x3a5edb
PA_Sync_State: Synchronized to PA
BIG_Encryption: Broadcast_Code required
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000000
bluetoothd[6013]: < ACL Data TX: Handle 0 flags 0x00 dlen 25
ATT: Write Command (0x52) len 20
Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7)
Data[18]: 040142c3b8726e6520486f75736500000000
Opcode: Set Broadcast_Code (0x04)
Source_ID: 1
Broadcast_Code[16]: 426f726e6520486f7573650000000000
> ACL Data RX: Handle 0 flags 0x01 dlen 2
ATT: Handle Multiple Value Notification (0x23) len 24
Length: 0x0014
Handle: 0x003a Type: Broadcast Receive State (0x2bc8)
Data[20]: 01018be5717a9a1900db5e3a0202010100000000
Source_ID: 1
Source_Address_Type: 1
Source_Address: 19:9A:7A:71:E5:8B
Source_Adv_SID: 0
Broadcast_ID: 0x3a5edb
PA_Sync_State: Synchronized to PA
BIG_Encryption: Decrypting
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000001
This adds support for entering the broadcast code on sink side. When
the user selects a transport, if the transport is encrypted, the user
will be prompted to enter the broadcast code before the process of
transport selection can continue.
This updates the documentation for endpoint.presets command and also add
some examples of how to enter extra capabilities/configuration and
how to setup custom presets.
If just the endpoint objects is passed to endpoint.presets then just
print it instead of the listing the presets available for the UUID:
[bluetooth]# endpoint.presets /local/endpoint/ep2
Preset 32_1_1
Configuration.#0: len 0x02 type 0x01
Configuration.Sampling Frequency: 32 Khz (0x06)
Configuration.#1: len 0x02 type 0x02
Configuration.Frame Duration: 7.5 ms (0x00)
Configuration.#2: len 0x03 type 0x04
Configuration.Frame Length: 60 (0x003c)
This implements the MediaAssistant "Push" command, to trigger the
BlueZ Broadcast Assistant to send stream information to the peer.
After issuing the "Push" command, the user is prompted to enter
any stream metadata to be sent to the peer. If the "auto" value
is chosen, the default metadata found in the BASE will be sent.
Otherwise, the LTVs found in the BASE will be overwritten by the
user input.
If the stream is encrypted, the user is also prompted to enter the
Broadcast Code for decrypting. If the "auto" value is chosen, a zero
filled array will be provided over DBus.
Below is a bluetoothctl log to exercise the "Push" command for an
unencrypted stream:
client/bluetoothctl
[bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes
[bluetooth]# AdvertisementMonitor path registered
[bluetooth]# scan on
[bluetooth]# [NEW] Device 00:60:37:31:7E:3F 00-60-37-31-7E-3F
[bluetooth]# connect 00:60:37:31:7E:3F
Attempting to connect to 00:60:37:31:7E:3F
[CHG] Device 00:60:37:31:7E:3F Connected: yes
[00-60-37-31-7E-3F]# Connection successful
[00-60-37-31-7E-3F]# [NEW] Device 15:19:44:63:76:7A 15-19-44-63-76-7A
[00-60-37-31-7E-3F]# [NEW] Assistant
/org/bluez/hci0/src_15_19_44_63_76_7A/dev_00_60_37_31_7E_3F/bis1
[00-60-37-31-7E-3F]# assistant.push
/org/bluez/hci0/src_15_19_44_63_76_7A/dev_00_60_37_31_7E_3F/bis1
[Assistant] Enter Metadata (auto/value): 0x03 0x02 0x04 0x00
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_15_19_44_63_76_7A/dev_00_60_37_31_7E_3F/bis1
State: pending
[00-60-37-31-7E-3F]# Assistant
/org/bluez/hci0/src_15_19_44_63_76_7A/dev_00_60_37_31_7E_3F/bis1
pushed
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_15_19_44_63_76_7A/dev_00_60_37_31_7E_3F/bis1
State: active
The btmon log below shows the GATT write command sent by the Assistant
and the GATT notification received from the peer:
< ACL Data TX: Handle 0 flags 0x00 dlen 32
ATT: Write Command (0x52) len 27
Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7)
Data[25]: 02017a766344191500c21a3702ffff01010000000403020400
Opcode: Add Source (0x02)
Source_Address_Type: 1
Source_Address: 15:19:44:63:76:7A
Source_Adv_SID: 0
Broadcast_ID: 0x371ac2
PA_Sync_State: Synchronize to PA - PAST not available
PA_Interval: 0xffff
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000001
Metadata: #0: len 0x03 type 0x02
Metadata: 04 00
> ACL Data RX: Handle 0 flags 0x01 dlen 6
ATT: Handle Multiple Value Notification (0x23) len 28
Length: 0x0018
Handle: 0x003a Type: Broadcast Receive State (0x2bc8)
Data[24]: 01017a766344191500c21a37020001010000000403020400
Source_ID: 1
Source_Address_Type: 1
Source_Address: 15:19:44:63:76:7A
Source_Adv_SID: 0
Broadcast_ID: 0x371ac2
PA_Sync_State: Synchronized to PA
BIG_Encryption: Not encrypted
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000001
Metadata: #0: len 0x03 type 0x02
Metadata: 04 00
The bluetoothctl log below shows the "Push" command flow for an
encrypted stream:
client/bluetoothctl
[bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes
[bluetooth]# AdvertisementMonitor path registered
[bluetooth]# scan on
[bluetooth]# [NEW] Device 00:60:37:31:7E:3F 00-60-37-31-7E-3F
[bluetooth]# connect 00:60:37:31:7E:3F
Attempting to connect to 00:60:37:31:7E:3F
[CHG] Device 00:60:37:31:7E:3F Connected: yes
[00-60-37-31-7E-3F]# Connection successful
[00-60-37-31-7E-3F]# [NEW] Device 05:1F:EE:F3:F8:7D 05-1F-EE-F3-F8-7D
[00-60-37-31-7E-3F]# [NEW] Assistant
/org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1
[00-60-37-31-7E-3F]# assistant.push
/org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1
[Assistant] Enter Metadata (auto/value): 0x03 0x02 0x04 0x00
[Assistant] Enter Broadcast Code (auto/value): 0x01 0x02 0x68 0x05 0x53
0xf1 0x41 0x5a 0xa2 0x65 0xbb 0xaf 0xc6 0xea 0x03 0xb8
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1
State: pending
[00-60-37-31-7E-3F]# Assistant
/org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1
pushed
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1
State: requesting
[00-60-37-31-7E-3F]# [CHG] Assistant
/org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1
State: active
The GATT write commands and notifications for this scenario are shown
in the btmon log below:
< ACL Data TX: Handle 0 flags 0x00 dlen 32
ATT: Write Command (0x52) len 27
Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7)
Data[25]: 02017df8f3ee1f0500f4015d02ffff01010000000403020400
Opcode: Add Source (0x02)
Source_Address_Type: 1
Source_Address: 05:1F:EE:F3:F8:7D
Source_Adv_SID: 0
Broadcast_ID: 0x5d01f4
PA_Sync_State: Synchronize to PA - PAST not available
PA_Interval: 0xffff
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000001
Metadata: #0: len 0x03 type 0x02
Metadata: 04 00
> ACL Data RX: Handle 0 flags 0x01 dlen 6
ATT: Handle Multiple Value Notification (0x23) len 28
Length: 0x0018
Handle: 0x003a Type: Broadcast Receive State (0x2bc8)
Data[24]: 01017df8f3ee1f0500f4015d020101000000000403020400
Source_ID: 1
Source_Address_Type: 1
Source_Address: 05:1F:EE:F3:F8:7D
Source_Adv_SID: 0
Broadcast_ID: 0x5d01f4
PA_Sync_State: Synchronized to PA
BIG_Encryption: Broadcast_Code required
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000000
Metadata: #0: len 0x03 type 0x02
Metadata: 04 00
< ACL Data TX: Handle 0 flags 0x00 dlen 25
ATT: Write Command (0x52) len 20
Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7)
Data[18]: 04010102680553f1415aa265bbafc6ea03b8
Opcode: Set Broadcast_Code (0x04)
Source_ID: 1
Broadcast_Code[16]: 0102680553f1415aa265bbafc6ea03b8
> ACL Data RX: Handle 0 flags 0x01 dlen 6
ATT: Handle Multiple Value Notification (0x23) len 28
Length: 0x0018
Handle: 0x003a Type: Broadcast Receive State (0x2bc8)
Data[24]: 01017df8f3ee1f0500f4015d020201010000000403020400
Source_ID: 1
Source_Address_Type: 1
Source_Address: 05:1F:EE:F3:F8:7D
Source_Adv_SID: 0
Broadcast_ID: 0x5d01f4
PA_Sync_State: Synchronized to PA
BIG_Encryption: Decrypting
Num_Subgroups: 1
Subgroup #0:
BIS_Sync State: 0x00000001
Metadata: #0: len 0x03 type 0x02
Metadata: 04 00
The print functions (print_service, print_chrc and print_desc) all print
the handle, but the handle is never set in the struct object. This
results in the handle always printing as 0x0000. Set the handle before
calling the print function.
This exposes the 'Unselect' method for Broadcast transports. This
allows the user to terminate the sync to a specific BIS, via a 2
step process. The first step is the call to this method, which
changes the transport's state to idle, with the second step being
done by the audio server which detects this change and releases
the transport.
This exposes the 'Select' method for Broadcast transports. This
allows the user to select the desired stream when running the setup
with PipeWire since it acquires any transport that is broadcasting.
This adds support for alternative preset to be entered so when auto
accepting configuration a different preset can be selected following the
order given to endpoint.presets.
This sets the number of channels based on the locations set rather than
always hardcoding it to 3 which in certain case is incorrect and can
lead for the same location to be configured multiple times.
This adds the initial implementation for the assistant menu in
bluetoothctl, to detect and print MediaAssistant objects.
The current BAP Broadcast Assistant implementation can be tested
by running bluetoothctl, connecting to a BASS Server, scanning
a Broadcast Source that is streaming a number of BISes with
audio capabilities matching the capabilities of the peer device,
and noticing the MediaAssistant objects being created:
client/bluetoothctl
[bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes
[bluetooth]# AdvertisementMonitor path registered
[bluetooth]# scan on
[bluetooth]# [NEW] Device 00:60:37:94:A6:A3 00-60-37-94-A6-A3
[bluetooth]# connect 00:60:37:94:A6:A3
Attempting to connect to 00:60:37:94:A6:A3
[CHG] Device 00:60:37:94:A6:A3 Connected: yes
[00-60-37-94-A6-A3]# Connection successful
[00-60-37-94-A6-A3]# [NEW] Device 15:65:78:B6:52:F6 15-65-78-B6-52-F6
[00-60-37-94-A6-A3]# [NEW] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis1
[00-60-37-94-A6-A3]# [NEW] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis2
[00-60-37-94-A6-A3]# scan off
[00-60-37-94-A6-A3]# Diovery stopped
[00-60-37-94-A6-A3]# disconnect
Attempting to disconnect from 00:60:37:94:A6:A3
[00-60-37-94-A6-A3]# Successful disconnected
[CHG] Device 00:60:37:94:A6:A3 Connected: no
[bluetooth]# [DEL] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis1
[bluetooth]# [DEL] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis2
This adds support for naming custom presets instead of always having
just one "custom" codec preset which needs to be overwriten everytime
a new set of settings needs to be entered.
In function 'cmd_send_transport':
error: passing argument 2 of 'getpeername' from incompatible pointer
type [-Wincompatible-pointer-types]
err = getpeername(transport->sk, &addr, &optlen);
| | ^~~~~
| | |
| | struct sockaddr_iso *
note: expected 'struct sockaddr * restrict' but argument is of
type 'struct sockaddr_iso *'
To resolve the compiler warnings, cast the pointer with
(struct sockaddr *).
client/advertising.c:
Allowing discoverable property to list in the parsing
function when discoverable is off.
Test steps:
From DUT, bluetoothctl go to menu advertise
set discoverable to off and then advertise on.
This fixes the usage of getpeername, introduced by 04153538aa
("client/player: Fix using unicast QoS for broadcast"), without
initializing optlen which causes the following problem:
Unable to send: Operation not permitted (1)
We are sending data to controller at wrong average rate not equal to
1 packet / SDU interval, if Transport_Latency is not an integer multiple
of SDU_Interval. The calculation currently may also give zero, so no
data gets sent.
We are sending data in bursts of num ~= Transport_Latency/SDU_Interval
packets, in hopes that possibly larger timer interval makes things more
efficient.
Fix the data rate by sending num packets every num*SDU_Interval, so that
the average data rate is correct.
Also fix use of itimerspect.it_value with TFD_TIMER_ABSTIME. The value
set previously is going to always be in the past in CLOCK_MONOTONIC so
just set it to 1.
Error: COPY_PASTE_ERROR (CWE-398): [#def95] [important]
client/player.c:1846:6: original: "qos->sync_cte_type" looks like the original copy.
client/player.c:1852:6: copy_paste_error: "sync_cte_type" in "qos->sync_cte_type" looks like a copy-paste error.
client/player.c:1852:6: remediation: Should it say "mse" instead?
1850| }
1851|
1852|-> if (qos->sync_cte_type) {
1853| bt_shell_printf("MSE %u\n", qos->mse);
1854| g_dbus_dict_append_entry(iter, "MSE", DBUS_TYPE_BYTE,
Error: ALLOC_FREE_MISMATCH (CWE-762): [#def37]
client/main.c:2108:2: alloc: Allocation of memory which must be freed using "g_free".
client/main.c:2108:2: assign: Assigning: "desc" = "g_strdup_printf("\x1b[0;94m[%s]\x1b[0m# ", attr)".
client/main.c:2111:2: free: Calling "free" frees "desc" using "free" but it should have been freed using "g_free".
2109|
2110| bt_shell_set_prompt(desc);
2111|-> free(desc);
2112| }
2113|
Error: CPPCHECK_WARNING (CWE-788): [#def36]
client/main.c:833: error[ctuArrayIndex]: Array index out of bounds; 'argv' buffer size is 0 and it is accessed at offset 1.
831| const char **opt;
832|
833|-> if (!strcmp(argv[1], "help")) {
834| for (opt = arg_table; opt && *opt; opt++)
835| bt_shell_printf("%s\n", *opt);
Error: CHECKED_RETURN (CWE-252): [#def35]
client/gatt.c:3191:3: check_return: Calling "write_value" without checking return value (as is done elsewhere 5 out of 6 times).
client/gatt.c:2371:2: example_checked: Example 1: "write_value(&chrc->value_len, &chrc->value, value, value_len, aad->offset, chrc->max_val_len)" has its value checked in "write_value(&chrc->value_len, &chrc->value, value, value_len, aad->offset, chrc->max_val_len)".
client/gatt.c:2502:2: example_checked: Example 2: "write_value(&chrc->value_len, &chrc->value, value, value_len, offset, chrc->max_val_len)" has its value checked in "write_value(&chrc->value_len, &chrc->value, value, value_len, offset, chrc->max_val_len)".
client/gatt.c:2919:2: example_checked: Example 3: "write_value(&desc->value_len, &desc->value, value, value_len, offset, desc->max_val_len)" has its value checked in "write_value(&desc->value_len, &desc->value, value, value_len, offset, desc->max_val_len)".
client/gatt.c:759:3: example_checked: Example 4: "write_value(&c->value_len, &c->value, value, value_len, offset, c->max_val_len)" has its value checked in "write_value(&c->value_len, &c->value, value, value_len, offset, c->max_val_len)".
client/gatt.c:775:3: example_checked: Example 5: "write_value(&d->value_len, &d->value, value, value_len, offset, d->max_val_len)" has its value checked in "write_value(&d->value_len, &d->value, value, value_len, offset, d->max_val_len)".
3189| }
3190|
3191|-> write_value(&chrc->value_len, &chrc->value, value, len,
3192| 0, chrc->max_val_len);
unregister-includes command takes two parameters service uuid and
included service uuid, since the space between them is missing,
the menu option is not working.
When two uuids separated with space is given, it is throwing error.