| 82d3d803 |
client: Add bluetoothctl-monitor.1 man page
This adds bluetoothctl-monitor.rst which is then converted to
bluetoothctl-mgmt.1 using rst2man. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +93, -2 |
| f0bfd762 |
client: Add bluetoothctl-mgmt.1 man page
This adds bluetoothctl-mgmt.rst which is then converted to
bluetooth-mgmt.1 using rst2man. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +562, -2 |
| 9ccebfa7 |
btmgmt: Add man page
This adds btmgmt.rst which is then converted to btmgmt.1 using rst2man. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +82, -2 |
| b9e93e01 |
midi: Fix build errors
This fixes the following build errors:
unit/test-midi.c:541:82: error: function definition is not allowed here
void compare_events_cb(const struct midi_write_parser *parser,
void *user_data) {
^
unit/test-midi.c:587:17: error: use of undeclared identifier
'compare_events_cb'; did you mean 'compare_events'?
compare_events_cb, &midi_data);
^~~~~~~~~~~~~~~~~
compare_events
profiles/midi/midi.c:61:75: error: function definition is not allowed
here
void foreach_cb(const struct midi_write_parser *parser, void *user_data) {
^
profiles/midi/midi.c:78:40: error: use of undeclared identifier 'foreach_cb'
midi_read_ev(&midi->midi_out, event, foreach_cb, midi);
^ |
Luiz Augusto von Dentz |
2 years ago |
2 files, +53, -48 |
| 2b063f47 |
client: Add support for mgmt submenu
This moves the functionality of btmgmt into client/mgmt.c so its
commands become available on bluetoothctl via mgmt submenu. |
Luiz Augusto von Dentz |
2 years ago |
5 files, +6070, -6041 |
| 17b229e8 |
iso-tester: Add test for BT_PKT_STATUS sockopt
This adds a test for setting BT_PKT_STATUS sockopt and checks if
BT_SCM_PKT_STATUS is properly received. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +89, -2 |
| 92bb384f |
bthost: Add support to set ISO Packet Status
This adds support to set ISO Packet Status to bthost_send_iso. |
Luiz Augusto von Dentz |
2 years ago |
3 files, +9, -9 |
| 9aff3f49 |
test-runner: fix behavior when no audio server
If no audio server, don't pass NULL to printf and parse TESTAUDIO
correctly. |
Pauli Virtanen |
2 years ago |
1 file, +3, -2 |
| 7cea6b96 |
test-runner: set non-quiet printk before running tests
It is useful to see WARN_ON etc. messages when running the tests.
The 'quiet' in cmdline suppresses levels >= WARN, so re-enable them
explicitly after boot, so that it is on by default and doesn't need to
be handled in local test scripts. |
Pauli Virtanen |
2 years ago |
1 file, +20, -0 |
| c62a4cb5 |
configure: Fix check ell path for cross compiling
Use of AC_CHECK_FILE prevents cross compilation.
Instead use test to support cross compiling. |
Rudi Heitbaum |
2 years ago |
1 file, +4, -3 |
| b8f916b7 |
test-eir: Run tests using bt_ad
This enables the same tests done with eir_data using bt_ad. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +51, -0 |
| bc2ab4ba |
shared/ad: Make use of util_iov_pull_* to parse data
This makes use of util_iov_pull_* helpers to parse data. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +251, -21 |
| d1b33eb8 |
shared/util: Introduce strisutf8
This introduces strisutf8 which can be used to verify if a string is
encoded using UTF-8 format. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +65, -0 |
| 9b0087bc |
main: Remove DEFAULT_SIRK
DEFAULT_SIRK is currently not used. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +0, -3 |
| c4846832 |
shared/ad: Use util_iov_push_* helpers to generate data
This makes use of util_iov_push_* helpers to generate the data. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +74, -89 |
| 838e1578 |
advertising: Fix build warning
This fixes the following warning:
src/advertising.c:942:2: warning: Null pointer passed to 2nd parameter
expecting 'nonnull' [core.NonNullParamChecker]
memcpy(cp->data + adv_data_len, scan_rsp, scan_rsp_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Luiz Augusto von Dentz |
2 years ago |
1 file, +3, -1 |
| 4578395b |
client/advetising: Allow use of EA data length
The code was supporting a maximum of 25 bytes (31 - 6) to be entered as
advertising data, but in case of EA is used that allows up to 245 bytes
(251 - 6) to be entered. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +1, -1 |
| 153aaeda |
advertising: Use bt_ad_set_max_len
This uses bt_ad_set_max_len to properly set the maximum data length of
the bt_ad instances based on what the kernel returns. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +4, -0 |
| 2cb07aa6 |
shared/ad: Fix hardcoding maximum data length
Instances shall not assume BT_AD_MAX_DATA_LEN is always the maximum
length as they could be used with EA which supports bigger length. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +36, -22 |
| b9e7ca94 |
mgmt-tester: Fix tests that consider 31 bytes the max adv lenght
This fixes a couple of tests that consider 31 bytes the max advertising
length since in case of extended advertising that number is actually
251. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +67, -4 |
| c96eb3ea |
test-runner: Add documentation
This adds test-runner.rst documentation with a few examples of how it
can be used to run kernel testers like mgmt-tester and also bluetoothd,
audio and Bluetooth controller plugged in the host system which is quite
useful when trying experimental features such LE Audio, etc. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +200, -0 |
| 8a8f8c14 |
shared/bass: Introduce Add Source opcode handler
This implements the Control Point handler for the Add Source operation. |
Iulia Tanasescu |
2 years ago |
5 files, +453, -18 |
| da85360a |
btio: Add options for binding iso broadcast address
This adds additional btio options, to allow binding a socket
to a broadcaster address. |
Iulia Tanasescu |
2 years ago |
2 files, +70, -11 |
| b7414606 |
plugins/admin: Fix heap-use-after-free when using 2 controllers
This commit fixes the heap-use-after-free error when connecting 2
controllers. When a controller is connected
admin_policy_adapter_probe is called. If policy_data was already
allocated it gets freed, if not, it only gets allocated. Eventually
add_interface is called. Here policy_data is put in the "data" variable
(specific for each controller) and the process_changes task is called
with idle priority. This function ultimately accesses policy_data from
the "data" variable.
When Bluez crashes the flow is:
1)first controller is attached
2)admin_policy_adapter_probe is called and policy_data is allocated
4)second controller is attached
5)admin_policy_adapter_probe is called and policy_data is freed, then
allocated again
6)process_changes runs and the policy_data for the first controller is
read, but it was already freed, thus the crash |
Vlad Pruteanu |
2 years ago |
1 file, +0, -1 |
| f9557931 |
monitor: Add decoding support for Sync Receiver events
This commit adds decoding support for PA Sync Established,
BIG Sync Established and BIG Sync Lost events. |
Claudia Draghicescu |
2 years ago |
2 files, +8, -0 |
| 8c317019 |
bap: wait for CIG to become configurable before recreating CIS
ISO sockets cannot be reconnected before all sockets in the same CIG
have been closed, if the CIG was previously active.
Keep track which endpoints have active CIG, and postpone connecting CIS
until their CIG is no longer active.
This addresses getting EBUSY from connect() when multiple CIS in the
same CIG move streaming -> qos at the same time, which disconnects CIS
and recreates them. The EBUSY originates from COMMAND_DISALLOWED
response to Set CIG Parameters.
This requires the kernel side do the Disconnect CIS / Remove CIG / Set
CIG Parameters HCI command steps in the right order, when all old
sockets are closed first before connecting new ones. |
Pauli Virtanen |
2 years ago |
1 file, +97, -10 |
| 7b10e72d |
shared/bap: detach io for source ASEs only after Stop Ready
The Client may terminate a CIS when sink is in QOS and source in
Disabling states (BAP v1.0.1 Sec 5.6.5). It may also terminate it when
Receiver Stop Ready has completed successfully (BAP v1.0.1 Sec 5.6.5.1).
It appears Samsung Galaxy Buds2 Pro (R510XXUOAWA5) ignores the Receiver
Stop Ready command if CIS is already disconnected, and then gets stuck
in disabling state. It works if CIS is disconnected after Receiver Stop
Ready.
For better compatibility as client for this device, and since it
shouldn't matter for us in which order we do it, disconnect CIS after
completion of Receiver Stop Ready, instead of immediately in Disabling.
We disconnect also if Receiver Stop Ready fails, given that
disconnecting in Disabled state should be OK.
Link: https://github.com/bluez/bluez/issues/516 |
Pauli Virtanen |
2 years ago |
1 file, +15, -18 |
| 19ce052d |
mgmt-tester: Add a regression test hitting hci_sync bug
Add a test "Add + Remove Device Nowait - Success" that hits a race
condition in kernel hci_sync.c. On current kernels this causes
BUG: KASAN: slab-use-after-free in hci_update_passive_scan_sync+0x857/0x1230
due to unsafe iteration of hdev->pend_le_conns (in Linux <= 6.4-rc4).
This seems to hit the race condition also without the added emulator
delay (since the emulator runs in the same thread), but it's better to
add the delay since otherwise it'll depend on timings on kernel side. |
Pauli Virtanen |
2 years ago |
1 file, +49, -0 |
| 80f2fa14 |
doc/tester-config: enable DEBUG_KERNEL, PROVE_RCU, DEBUG_ATOMIC_SLEEP
Add more lock/sleep debugging to the default tester config.
Enable DEBUG_KERNEL since olddefconfig won't enable PROVE_LOCKING
without it. Enable PROVE_RCU to also check RCU usage. Enable
DEBUG_ATOMIC_SLEEP to catch those as well. |
Pauli Virtanen |
2 years ago |
2 files, +6, -0 |
| 8fd0c76b |
shared/bap: use only nonzero req->id
In bap_req_new, use same pattern as elsewhere to not use zero as
a valid id. |
Pauli Virtanen |
2 years ago |
1 file, +1, -1 |
| 466fce02 |
transport: handle BAP Enabling state correctly when resuming
If BAP stream is in Enabling state when transport acquire is attempted,
we should wait for bap_state_changed to emit the completion event.
transport->resume() is only called with new owner with no
owner->pending, and shall return nonzero completion id on success.
Currently if BAP stream is Enabling, it returns zero which fails the
acquire operation.
To fix this, return valid completion id in this case instead. Also keep
track of the g_idle_add resume id, so that we don't try to give it to
bt_bap_stream_cancel.
Fixes sound server getting spurious Not Authorized errors when trying to
acquire a pending transport. This can happen on BAP server: linked
transports become pending when the first of the two enters Streaming. If
sound server tries to acquire the other linked transport whose stream is
still Enabling, the acquire fails (media_owner_free +
btd_error_not_authorized).
Log:
===============================================================
profiles/audio/transport.c:bap_state_changed() stream 0x25c2880: qos(2) -> enabling(3)
...
profiles/audio/transport.c:bap_state_changed() stream 0x25cc590: qos(2) -> enabling(3)
...
src/shared/bap.c:bap_stream_state_changed() stream 0x25cc590 dir 0x01: enabling -> streaming
profiles/audio/bap.c:bap_state() stream 0x25cc590: enabling(3) -> streaming(4)
profiles/audio/transport.c:bap_state_changed() stream 0x25cc590: enabling(3) -> streaming(4)
/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd1: fd(36) ready
profiles/audio/transport.c:transport_update_playing() /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd1 State=TRANSPORT_STATE_IDLE Playing=1
profiles/audio/transport.c:transport_set_state() State changed /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd1: TRANSPORT_STATE_IDLE -> TRANSPORT_STATE_PENDING
profiles/audio/transport.c:transport_set_state() State changed /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd0: TRANSPORT_STATE_IDLE -> TRANSPORT_STATE_PENDING
profiles/audio/transport.c:media_owner_create() Owner created: sender=:1.1242
profiles/audio/transport.c:media_owner_free() Owner :1.1242
=============================================================== |
Pauli Virtanen |
2 years ago |
1 file, +55, -12 |
| 19319bd3 |
transport: Fix crash on Transport.Acquire
This fixes crash introduced by 3030883 which caused requests not be
initialized properly for A2DP.
Fixes: https://github.com/bluez/bluez/issues/542 |
Luiz Augusto von Dentz |
2 years ago |
1 file, +6, -5 |
| d764f78f |
Release 5.68 |
Marcel Holtmann |
2 years ago |
2 files, +4, -1 |
| d4b9d89f |
Release 5.67 |
Marcel Holtmann |
2 years ago |
2 files, +15, -1 |
| 58c08ed1 |
build: Add generated manual pages and binaries to .gitignore |
Marcel Holtmann |
2 years ago |
1 file, +9, -0 |
| 2a1a3b48 |
build: Use LT_INIT instead of AC_PROG_LIBTOOL |
Marcel Holtmann |
2 years ago |
1 file, +2, -2 |
| 8c760ce9 |
build: Update library version |
Marcel Holtmann |
2 years ago |
1 file, +1, -1 |
| ddfa4097 |
shared/bap: Fix handling of codec fields
Codec fields needs to be converted when codec.id is 0xff as the host
endian may not always be little endian. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +11, -0 |
| d6bfbd28 |
shared/bap: Fix parsing of vendor specific codecs
While parsing vendor specific codecs cid and vid fields need to be
converted using le16_to_cpu. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +5, -0 |
| 6b9d1670 |
android: Fix compiler warning from GCC
This ignores the following two warnings from the compiler.
CC android/gatt.o
android/gatt.c: In function ‘handle_client_register_for_notification’:
android/gatt.c:3733:9: error: ‘memcpy’ offset [0, 16] is out of the bounds [0, 0] [-Werror=array-bounds=]
3733 | memcpy(¬ification->ch, &cmd->char_id, sizeof(notification->ch));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC android/gatt.o
android/gatt.c: In function ‘handle_client_register_for_notification’:
android/gatt.c:3735:9: error: ‘memcpy’ writing 17 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
3735 | memcpy(¬ification->ch, &cmd->char_id, sizeof(notification->ch));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It could be possible that these warnings are valid or they might be a
false positive. However since this is Android based code based on
Android HAL headers, just set pragma to ignore them. |
Marcel Holtmann |
2 years ago |
1 file, +4, -0 |
| b00bc612 |
isotest: Add check after accepting connection
This checks for the POLLERR event on a newly accepted connection,
to determine if the connection was successful or not. |
Iulia Tanasescu |
2 years ago |
1 file, +26, -0 |
| 1d6456a2 |
iso-tester: Fix checks of latency and interval
Due to rounding of latency, BAP uses msec while HCI uses slots of
1.25 ms, values may not return an exact match which is fine since the
BAP QoS suggests they are the maximum latency/interval so values bellow
that shall be considered a match. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +4, -4 |
| 3f018d52 |
btdev: Fix CIS Established Event parameters
ISO Interval and Transport Latency were inverted. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +12, -6 |
| 97a07d84 |
btdev: Fix LE CIS Established Event
LE CIS Established Event Transport Latency shall follow the formula from
the spec:
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 6, Part G
page 3050:
Transport_Latency_C_To_P = CIG_Sync_Delay + FT_C_To_P ×
ISO_Interval - SDU_Interval_C_To_P
Transport_Latency_P_To_C = CIG_Sync_Delay + FT_P_To_C ×
ISO_Interval - SDU_Interval_P_To_C |
Luiz Augusto von Dentz |
2 years ago |
1 file, +31, -12 |
| 37042ca9 |
monitor: Use get_le24 to convert 24 bits values
This uses get_le24 to convert 24 bits microseconds values. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +2, -4 |
| 2f347933 |
btdev: Fix CIS Establish ISO Interval
ISO Interval is actually using 1.25 ms slots so it needs to be properly
converted. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +1, -1 |
| dafec5e4 |
monitor: Fix decoding of HCI CIS Established Event
The ISO Interval is actually using set using 1.25ms slots:
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
page 2304:
Time = N * 1.25 ms |
Luiz Augusto von Dentz |
2 years ago |
1 file, +1, -1 |
| c8235156 |
adapter: Handle Device Found Event with Scan Response flag
This handles recently introduced Scan Response flag since that
shouldn't affect connectable flag the device would be considered
connectable but it shall not create a new device by itself. |
Luiz Augusto von Dentz |
2 years ago |
4 files, +32, -38 |
| 741a04ab |
monitor: Add missing flags to MGMT Device Found Event
This adds the missing flags to MGMT Device Found Event so they can be
decoded properly. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +2, -0 |
| 98383b91 |
mgmt-api: Update Device Found Event documentation
This updates Device Found Event documentation to mention the new flag
introduced to track when the event is generated due a interleaved Scan
Response that couldn't be merged. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +1, -0 |