src/advertising.c
Include check for broadcast mode:
AD flags shall never be set for broadcast
Test steps:
From DUT, bluetoothctl go to menu advertise
advertise.secondary 1M/2M
advertise.name on
advertise broadcast
This removes BAP support for long-lived PA sync (added for Scan Delegator
support), since it is now handled inside the BASS plugin. This also
removes the PA idle timer logic, since PA/BIG sync requests are now
ordered inside the kernel.
This removes the BAP API to probe broadcasters from BASS, since BASS is
now directly adding the Broadcast Audio Announcement Service UUID to the
broadcaster device, and it will internally handle the probe.
This updates the Scan Delegator implementation to be handled internally in
BASS: The BASS Server is responsible to handle Write Commands for the Add
Source operation by creating long-lived PA sync, parsing the BASE,
creating and configuring BAP streams, as well as enabling them.
This make the default BAP QoS parameters for PA Create Sync public,
to be available to other plugins that might need to listen for
Broadcasters (like BASS).
This replaces the internal parse_base with bt_bap_parse_base from
shared/bap. A bis callback is added to handle parsed streams.
The Broadcast Assistant implementation in the BASS plugin is also
updated to use bap qos instead of iso qos, since the BISes are
now parsed along with bap qos structure.
This adds public BAP helpers to convert iso_qos to bap_qos and reversed.
This is needed for the BASS plugin to handle the Scan Delegator (BASS
Server) role internally (to create/handle BAP streams when receiving the
Add Source command from a Broadcast Assistant).
This adds a shared/bap helper to parse BASE. Any plugin that wishes to
parse a BASE structure can call this helper and provide a callback to
process each BIS.
gcc-15 switched to -std=c23 by default:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
As a result `bluez` fails the build as:
src/shared/gatt-helpers.c:1136:24: error: incompatible types when returning type '_Bool' but 'struct bt_gatt_request *' was expected
1136 | return false;
| ^~~~~
src/shared/gatt-helpers.c:1250:24: error: incompatible types when returning type '_Bool' but 'struct bt_gatt_request *' was expected
1250 | return false;
| ^~~~~
src/shared/gatt-helpers.c:1478:24: error: incompatible types when returning type '_Bool' but 'struct bt_gatt_request *' was expected
1478 | return false;
| ^~~~~
bt_att_chan_set_security attempts to set BT_SECURITY without first
checking what is the current security level which may cause errors
since the kernel does actually return -EINVAL when the security doesn't
change.
StartNotify / StopNotify already correctly allows usage when the
characteristic indicate is present (simplify this check though),
apply the same to AcquireNotify.
Fixes: https://github.com/bluez/bluez/issues/1022
In the case of our products, we lack a physical RFKILL switch and do
not have the rfkill module enabled in the kernel which resulted in an
error message each time bluetoothd was started.
This commit looks at the errno code after failing to open the RFKILL
device and only logs an error if it is something other than ENOENT
(No such file or directory).
Fixes: https://github.com/bluez/bluez/issues/792
This change is required in below PTS testcase:
1. FTP/SR/SGSIT/ATTR/BV-02-C
Attribute GSIT - Bluetooth Profile Descriptor List
Current FTP version 1.2 is being deprecated and withdrawn
from BT Sig, so it is mandatory to update the version to 1.3.
No additional changes are needed for supporting the new version.
This change is required for passing below PTS testcases:
1. PBAP/PSE/PBD/BV-02-C
2. PBAP/PSE/PBD/BV-03-C
3. PBAP/PSE/PBD/BI-01-C
4. PBAP/PSE/PBD/BV-13-C
5. PBAP/PSE/PBD/BV-14-C
6. PBAP/PSE/PBD/BV-17-C
PTS sends all the GET phonebook requests without extra params.
Therefore, the PBAP server is rejecting the requests with a
'Bad Request' response.
So append 'maxlistcount' as default param in GET request to
avoid testcase failure.
This fix is required for below PTS testcase:
1. PBAP/PCE/SSM/BV-10-C
Description - Verify that the PCE does not share its
PbapSupportedFeatures bits with a legacy server.
Incase of legacy server, check for 'supported features bit'
uint_32_t value instead of directly checking the pointer
holding the attribute.
As pointer 'data' won't be null as PbapSupportedFeatures
attribute is present in SDP record but it's value is zero.
This fix is required for passing below PTS testcases:
1. PBAP/PSE/PBD/BV-05-C
2. PBAP/PSE/PBD/BV-17-C
3. PBAP/PSE/PBB/BV-11-C
Even if the new missed calls value is zero, send it in GET response.
As per the PBAP spec, it is mandatory to include Newmissedcalls
tag in response incase of object name is 'mch.vcf' or 'cch.vcf'.
It will be better to include it in all GET response.
We no longer reconnect AVRCP session on AVDTP transport reconfiguration.
This breaks AVRCP volume after reconfiguration, since there's no volume
update event incoming.
Fix by keeping track of the latest volume in btd_device volume. It was
introduced to track volume changes that arrive when there are no
transports/players, but we should track all volume changes otherwise the
value can be out of date when we want to use it.
Fixes: 469a75ae18 ("sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle")
If the stream has been confirmed to be closed it should be safe to
attempt to send SetConfiguration without having to wait for a period
since the remote end can assume no new stream would be created it may
end up disconnecting the session.
If the stream transition to AVDTP_STATE_IDLE it means the stream has
been disconnected, not the session, therefore
btd_service_disconnecting_complete shall not be called otherwise it may
trigger the policy plugin to disconnect AVRCP in cases like codec
reconfiguration.
If the stream transition to AVDTP_STATE_IDLE it means the stream has
been disconnected, not the session, therefore
btd_service_disconnecting_complete shall not be called otherwise it may
trigger the policy plugin to disconnect AVRCP in cases like codec
reconfiguration.
Fixes: https://github.com/bluez/bluez/issues/1003
Zephyr(1) has been using the same bus defines as Linux so tools likes of
btmon, etc, are able to decode the bus under HCI, so this attempts to
synchronize the definitions by adding the missing bus type IPC(11) and its
decoding string.
[1] https://github.com/zephyrproject-rtos/zephyr/pull/80808
Currently obexd uses session bus.
Distros where session bus is not supported and still obex profiles
are required in that case use system bus instead of session bus
which can be configured at run time.
An Command line option has been added to achieve it.
{ "system-bus", 's', 0, G_OPTION_ARG_NONE, &option_system_bus,
"Use System bus "}
we can use option obexd -s to use system bus.
This adds a new Broadcast Receiver test, for a Broadcast Sink
synchronizing to 2 Broadcasters, using defer setup.
ISO Broadcaster Receiver2 Defer - Success
This fixes memory leaks that appear in iso_accept_cb because a new io
channel is allocated but never unreferenced at the end of the test.
=================================================================
==20460==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 120 byte(s) in 1 object(s) allocated from:
#0 0x7dcddc8fbb37 in malloc ../../../../src/libsanitizer/asan/
asan_malloc_linux.cpp:69
#1 0x7dcddc719af9 in g_malloc (/lib/x86_64-linux-gnu/
libglib-2.0.so.0+0x62af9)
#2 0x7dcddc7722bd in g_io_channel_unix_new
(/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xbb2bd
#3 0x5d3fdfe28262 in iso_accept_cb tools/iso-tester.c:3004
Indirect leak of 6 byte(s) in 1 object(s) allocated from:
#0 0x7dcddc8fbb37 in malloc ../../../../src/libsanitizer/asan/
asan_malloc_linux.cpp:69
#1 0x7dcddc719af9 in g_malloc (/lib/x86_64-linux-gnu/
libglib-2.0.so.0+0x62af9)
#2 0x7dcddc70016f in g_io_channel_init
(/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4916f)
#3 0x7dcddc7722c8 in g_io_channel_unix_new
(/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xbb2c8)
#4 0x5d3fdfe28262 in iso_accept_cb tools/iso-tester.c:3004
SUMMARY: AddressSanitizer: 126 byte(s) leaked in 2 allocation(s).
66a8c522b64 ("adapter: Fix up address type when loading keys") didn't
fix all instances of wrong address type being loaded, so peripheral LTK
and IRK were still left with possible invalid types.
If a2dp_resume/a2dp_suspend are called while setup is being
reconfigured, they make the reconfiguration use wrong SEP. This occurs
if transport Acquire/Release are called while reconfiguration is waiting
for CLOSE_RSP.
Fix by failing a2dp_resume/suspend early without changing the setup, if
it is reconfiguring.
Such resume/suspend calls would in any case fail, because
avdtp_close(stream) has been done, so avdtp_suspend/resume would return
error.
User can cancel transport acquire by calling Release() while Acquire()
is in progress. This calls a2dp_cancel() which sends AVDTP_ABORT_CMD,
forcing AVDTP state transition to IDLE, and A2DP profile disconnects.
However, Release()/Acquire() should only result to transitions between
STREAMING/OPEN. The expected behavior is that either these calls return
error, or they block until the target state is reached.
Fix by: Release() during pending Acquire() first sends error reply to
the Acquire. Then it waits for START to complete, then sends SUSPEND,
and after that completes, then it replies.
This also fixes SetConfiguration() after canceled Acquire(), which
previously did not work due to AVDTP disconnect. Now it does
START/SUSPEND -> CLOSE -> reconfigure.
If the searched key is a prefix of the first key in the textfile,
the code will assume it's not the first line which is wrong.
The issue can be reproduced by a fuzzer. More context can be found in
https://issues.oss-fuzz.com/issues/42515619
To reproduce the issue, please kindly follow the instructions in
https://google.github.io/oss-fuzz/advanced-topics/reproducing/
Stack trace:
#0 0x55e1c450e7ce in find_key /src/bluez/src/textfile.c:133:9
#1 0x55e1c450e7ce in write_key /src/bluez/src/textfile.c:244:8
#2 0x55e1c450dc33 in LLVMFuzzerTestOneInput /src/fuzz_textfile.c:61:3
(...trace in fuzzer)
This fixes the following build error:
profiles/input/manager.c:102:4: error: implicit declaration of function ‘free’ [-Werror=implicit-function-declaration]
102 | free(uhid_enabled);
| ^~~~
This adds a call to g_dbus_set_debug which enabled debugging of D-Bus
messages when dynamic debug is enabled for main.c:
bluetoothd[3672799]: [:1.38799:method_call] > org.bluez.Device1.Connect [#761]
bluetoothd[3672799]: [:1.38799:error] < org.bluez.Error.Failed [#761]
In order to properly synchronize audio/video playback it is required
to report audio delay to the A2DP source. This commit allows connected
media application to update the Delay property of the A2DP transport
which will inform remote source about the playback delay.
In case when the transport is not acquired, everyone is allowed to set
the delay. However, when the transport is acquired only the owner can
modify the delay. This restriction is here to prevent interference
caused by 3rd party actors.
The functionality was tested by streaming audio between two hosts
running BlueZ Bluetooth stack.
This function allows to retrieve D-Bus message sender name in a property
setter callback. Message sender name might be required to limit write
access to authorized clients only.