| 67a26abe |
profile: Add probe_on_discover flag
This adds probe_on_discover flag which indicates if profile needs to be
probed when the remote_uuid is discovered and changes device logic to
attempt to probe driver when a new UUID is discovered and
probe_on_discover is set. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +22, -5 |
| 3370c462 |
adapter: Do not filter out broadcast advertiser
This allows a broadcast advertiser to be passed up to application,
if the adapter has the capability of being a Synchronized Receiver. |
Claudia Draghicescu |
2 years ago |
1 file, +8, -0 |
| 58aa93f3 |
eir: Add eir_get_service_data
This adds eir_get_service_data function which can be used to get a
specific service data. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +24, -0 |
| 7b3aa053 |
btio: Add support for getsockopt(BT_ISO_BASE)
This adds the posibility for a broadcast sink to retrieve the
BASE information received from a source afeter a PA synchronization,
using the getsockopt(BT_ISO_BASE) function.
This needs the patch from bluetooth-next:
Bluetooth: ISO: Add support for periodic adv reports processing |
Claudia Draghicescu |
2 years ago |
1 file, +11, -2 |
| 4352a42e |
client/player: Add broadcast sink endpoint
Added support for broadcast sink registration using the 0x1851 UUID.
Added support for remote endpoint creation when a broadcast source
is discovered.
Added support for creating a local endpoint when the broadcast sink
endpoint was registered from an external application (Pipewire).
To test this feature use the following commands:
[bluetooth]# endpoint.register 00001851-0000-1000-8000-00805f9b34fb 0x06
[bluetooth]# scan on
[NEW] Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0
[bluetooth]# endpoint.config
/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0
/local/endpoint/ep0 16_2_1 |
Claudia Draghicescu |
2 years ago |
1 file, +53, -8 |
| 96de1c6e |
iso-tester: test busy CIG error does not drop existing connections
A second connection made with same CIG while the CIG is busy, shall not
disconnect the first already existing connection.
Add test for this:
ISO Connect2 Busy CIG 0x01 - Success/Invalid
This was the original intent of "ISO Connect2 CIG 0x01 -
Success/Invalid", but the busy check should not be made synchronously in
connect() (to maintain ordering with Remove CIG etc), but must be done
in hci_sync. So the test needs to check the error async and explictly
that the first conn is not dropped. |
Pauli Virtanen |
2 years ago |
1 file, +85, -0 |
| 459b095c |
btdev: fix CIG ID on Set CIG Parameters error response
Set CIG Parameters shall return correct CIG ID in Command_Complete also
when it errors. |
Pauli Virtanen |
2 years ago |
1 file, +2, -1 |
| 59569c1f |
a2dp: Expose "Key missing" error
This error is not expected and retries will likely end up with same error. |
Simon Mikuda |
2 years ago |
1 file, +1, -0 |
| 0ee60b31 |
error: Add "Invalid exchange" mapping
This error is returned on this event:
> HCI Event: Auth Complete (0x06) plen 3
Status: PIN or Key Missing (0x06)
Handle: 11 Address: 00:00:00:00:00:00 (OUI 00-00-00) |
Simon Mikuda |
2 years ago |
2 files, +6, -0 |
| b9c57e81 |
main: Fix missing comma |
Karl Bieber |
2 years ago |
1 file, +1, -1 |
| d987ff34 |
monitor: Plot RX information with -a/--analyze
This attempts to plot the RX information just as TX:
Found BR-ACL connection with handle 256
Address: XX:XX:XX:XX:XX:XX
RX packets: 60/60
RX Latency: 0-39040 msec (~20294 msec)
RX size: 6-344 octets (~34 octets)
RX speed: ~0 Kb/s
100 +-+------------------------------------------------------------------+
+| |
+| RX +-----+ |
+| |
+| |
+| |
| |
| |
10 +-| |
+| |
+| |
+| |
+| |
+| |
| |
| |
1 +-| + + + |
+| | | | |
++------------------------------------------------------------------+
+ + + + + + + + +
0 5000 10000 15000 20000 25000 30000 35000 40000
Latency (ms)
TX packets: 22548/22547
TX Latency: 3-73 msec (~11 msec)
TX size: 6-850 octets (~847 octets)
TX speed: ~568 Kb/s |
Luiz Augusto von Dentz |
2 years ago |
1 file, +104, -75 |
| 9665025c |
iso-tester: Fix test ISO Connect2 CIG 0x01 - Success/Invalid
This test shall succeed rather than fail as this appears to be a bug in
the kernel code preventing Set CIG Parameters to work properly when
there are concurrent tasks only one CIS is being programmed. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +3, -26 |
| 033b68cb |
iso-tester: add tests checking Remove CIG is emitted
Kernel should send LE Remove CIG after all CIS are shut down. Add tests
checking this, closing either immediately or after waiting connection to
complete.
ISO Defer Close - Success
ISO Connect Close - Success
ISO Defer Wait Close - Success
ISO Connect Wait Close - Success |
Pauli Virtanen |
2 years ago |
1 file, +96, -0 |
| 10d83e34 |
iso-tester: test with large CIS_ID and invalid CIG_ID/CIS_ID
Add test with a large CIS_ID and multiple CIS so it hits an error
condition in current kernels (which is why the AC configuration is
used).
Add tests for invalid configurations with bad or duplicate IDs, and for
trying to connect two CIS in same CIG without BT_DEFER_SETUP.
ISO QoS CIG 0xF0 - Invalid
ISO QoS CIS 0xF0 - Invalid
ISO Connect2 CIG 0x01 - Success/Invalid
ISO AC 6(ii) CIS 0xEF/auto - Success
ISO AC 6(ii) CIS 0xEF/0xEF - Invalid |
Pauli Virtanen |
2 years ago |
1 file, +72, -0 |
| 80c8266a |
sco-tester: test local and remote disconnecting simultaneously
Demonstrate a kernel race condition when remote side disconnects at the
same time as local side tries to cancel the connection. I.e.
[controller] > HCI Synchronous Connect Complete
[controller] > HCI Disconnection Complete (from remote)
[user] shutdown(sco_socket)
[kernel] hci_conn_abort(SCO handle)
[kernel] > HCI Create Connection Cancel
[kernel] < HCI Synchronous Connect Complete
[kernel] < HCI Disconnect Complete
[controller] < HCI Create Connection Cancel
[controller] > HCI Command Status (Create Connection Cancel)
[kernel] < HCI Command Status (Create Connection Cancel)
and then we get BUG: KASAN: slab-use-after-free in hci_conn_failed when
hci_conn_abort tries to delete the same connection a second time.
This type of crash is probably not limited to the sequence here, but for
this one it was possible to get the timing right in the emulator.
Add a test that hits this in the emulator environment (pretty narrow
window to hit on real hardware):
eSCO Simultaneous Disconnect - Failure |
Pauli Virtanen |
2 years ago |
1 file, +59, -0 |
| 23a7d400 |
btdev: fix Command Status command opcodes for Setup Sync Conn
The command opcode should be the CMD, not EVT. |
Pauli Virtanen |
2 years ago |
1 file, +2, -2 |
| 5815a924 |
btdev: check error conditions for HCI_Create_Connection_Cancel
Create Connection Cancel shall return Command Complete with error status
when there is no Create Connection that can be canceled. In these
cases, we should not send a (spurious) Connection Complete event.
Fix by keeping a list of pending Create Connection commands, and
returning command errors if there is none pending at the moment. |
Pauli Virtanen |
2 years ago |
2 files, +79, -11 |
| 80107630 |
monitor/analyze: Inline data to gnuplot
Instead of creating a separate file just to write the x:y axis inline
the data via gnuplot $data variable then use it to plot. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +10, -18 |
| 1f6e606c |
monitor: Add connection tracking for SCO/ISO with -a/--analyze
This adds proper connection tracking to SCO/ISO connection by handling
the events that establishes them. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +107, -1 |
| 6bb47680 |
monitor: Print channel latency information with -a/--analyze
This prints channel latency information and use gnuplot when using
-a/--analyze to plot a graph of channels:
Found TX L2CAP channel with CID 68
PSM 25
22490 packets
7-50 msec (~11 msec) TX Latency
850-850 octets TX packet size
~569 Kb/s TX transfer speed
10000 +-+----------------------------------------------------------------+
+| ++ |
+| || + Packets +-----+ |
+| + || | |
1000 +-| | || |+ ++ |
+| | || || || + |
+| | || || ||+ +| |
+| | || || ||| || ++ ++ |
100 +-| | || || ||| || || || + |
+| | || || ||| || || || ++| + + |
+| | || || ||| || || || ||| | | |
+| | || || ||| || || || ||| |+ +| + |
| | || || ||| || || || ||| || || |+ + |
10 +-| | || || ||| || || || ||| || || || |+ |
+| | || || ||| || || || ||| || || || || + |
+| +| || || ||| || || || ||| || || || ||+ ++ |+ ++ + |
| || || || ||| || || || ||| || || || ||| || || || | |
1 +-| || || || ||| || || || ||| || || || ||| || || || | + + |
++----------------------------------------------------------------+
+ + + + + + + + + +
5 10 15 20 25 30 35 40 45 50
Latency (ms) |
Luiz Augusto von Dentz |
2 years ago |
1 file, +100, -55 |
| 54740308 |
monitor/analyze: Use conn_pkt_tx on acl_pkt
This makes use of conn_pkt_tx also on acl_pkt like other connections. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +19, -30 |
| 60463355 |
monitor: Add TX frame number and speed estimation
This adds the frame information while decoding:
> HCI Event: Number of Completed Packets (0x13) plen 5
Num handles: 1
Handle: 256 Address: XX:XX:XX:XX:XX:XX
Count: 1
#188: len 850 (755 Kb/s)
Latency: 9 msec (3-21 msec ~6 msec)
Channel: 68 [PSM 25 mode Basic (0x00)] {chan 4}
Channel Latency: 9 msec (7-21 msec ~9 msec)
Or the speed estimation while analyzing:
Found BR-ACL connection with handle 256
Address: XX:XX:XX:XX:XX:XX
60 RX packets
22548 TX packets
22547 TX completed packets
3-73 msec (~11 msec) TX Latency
6-850 octets (~847 octets) TX packet size
~568 Kb/s TX transfer speed |
Luiz Augusto von Dentz |
2 years ago |
3 files, +33, -13 |
| 8eb1dee8 |
gatt: Fix not establishing a socket for each device
AcquireWrite and AcquireNotify shall establish a socket pair for each
device connected otherwise the application cannot distinct the
operations of each client.
Fixes: https://github.com/bluez/bluez/issues/460 |
Luiz Augusto von Dentz |
2 years ago |
1 file, +137, -21 |
| 8d60b555 |
monitor: Add parsing Service Data of UUID 128
In the advertising report, instead of deciding EIR 0x21 into this:
Unknown EIR field 0x21: 3a048f2ba97ea6ae1b49c619e973a4a701480d130d
We can do bit better
Service Data UUID 128: Vendor specific
Data: 01480d130d
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> |
Łukasz Rymanowski |
2 years ago |
1 file, +12, -0 |
| 652e8b8d |
monitor: Add support to decode le read ISO link quality
btmon: Add parsing LE Read ISO link quality
> HCI Event: Command Complete (0x0e) plen 34
LE Read ISO link quality (0x08|0x0075) ncmd 1
Status: Success (0x00)
Handle: 98
TX unacked packets 0
TX flushed packets 257602
TX last subevent packets 0
TX retrnansmitted packets 0
TX crc error packets 2594
RX unreceived packets 0
Duplicated packets 0 |
Łukasz Rymanowski |
2 years ago |
2 files, +59, -0 |
| af354972 |
monitor/ll: Add support for connection parameter command.
LL_CONNECTION_PARAM_REQ (0x0f)
Interval min: 7.50 msec (0x0006)
Interval max: 7.50 msec (0x0006)
Latency: 0 (0x0000)
Timeout: 5000 msec (0x01f4)
Preffered periodicity: 0.00 (0x00)
Reference connection event count: 4 (0x04)
Offset 0: 0.00 msec (0x00)
Offset 1: 0.00 msec (0x00)
Offset 2: 1.25 msec (0x01)
Offset 3: 0.00 msec (0x00)
Offset 4: 2.50 msec (0x02)
Offset 5: 0.00 msec (0x00)
LL_CONNECTION_PARAM_RSP (0x10)
Interval min: 7.50 msec (0x0006)
Interval max: 7.50 msec (0x0006)
Latency: 0 (0x0000)
Timeout: 5000 msec (0x01f4)
Preffered periodicity: 0.00 (0x00)
Reference connection event count: 4 (0x04)
Offset 0: 318.75 msec (0xff)
Offset 1: 318.75 msec (0xff)
Offset 2: 318.75 msec (0xff)
Offset 3: 318.75 msec (0xff)
Offset 4: 318.75 msec (0xff)
Offset 5: 318.75 msec (0xff) |
Szymon Czapracki |
2 years ago |
2 files, +88, -2 |
| 7c6e030a |
monitor: Update le event mask with bits 20-23 |
Łukasz Rymanowski |
2 years ago |
1 file, +4, -0 |
| 86a40156 |
monitor: Fix decoding Command Complete for Remove ISO Data path
Before
< HCI Command: LE Remove Isochronous Data Path (0x08|0x006f) plen 3
Connection Handle: 96
Data Path Direction: Output (Controller to Host) (0x01)
> HCI Event: Command Complete (0x0e) plen 6
LE Remove Isochronous Data Path (0x08|0x006f) ncmd 1
invalid packet size
00 60 00
After patch
< HCI Command: LE Remove Isochronous Data Path (0x08|0x006f) plen 3
Connection Handle: 96
Data Path Direction: 0x01
Input (Host to Controller)
> HCI Event: Command Complete (0x0e) plen 6
LE Remove Isochronous Data Path (0x08|0x006f) ncmd 1
Status: Success (0x00)
Connection handle: 96 |
Łukasz Rymanowski |
2 years ago |
2 files, +8, -1 |
| 1dbd9ba1 |
Rename BAA_SERVICE to BCAA_SERVICE add BAA_SERVICE(0x1851)
Rename BAA_SERVICE to BCAA_SERVICE and added BAA_SERVICE(0x1851)
as UUID for the broadcast sink. |
Silviu Florian Barbulescu |
2 years ago |
4 files, +12, -9 |
| 446d8ada |
main: Fix integer configuration option parse failures
parse_config_int() has a obvious logical error, so causes many
parse failures of integer configuration options, fixed by this
change. |
Zijun Hu |
2 years ago |
1 file, +1, -1 |
| 255ef572 |
adapter: Update ConnectDevice documentation |
Simon Mikuda |
2 years ago |
1 file, +3, -2 |
| caf7db31 |
adapter: Be able to use ConnectDevice for discovered devices
This can be useful when you want to specify trasport type for already
paired device (e.g. use LE transport for dual mode device). |
Simon Mikuda |
2 years ago |
1 file, +0, -3 |
| dce3971d |
monitor/analyze: Fix not calculating latency for ISO/SCO packets
ISO/SCO packets latency was not being calculated because no connection was
being assigned to them. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +52, -4 |
| b4cf0900 |
monitor/analyze: Fix not dequeing TX packet properly
num_completed_packets_evt contain a count for how many packets have been
completed per handle. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +9, -6 |
| f1509394 |
monitor: Fix not calculating latency for ISO/SCO packets
ISO/SCO packets latency was not being calculated because no connection
was assigned to them. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +24, -0 |
| 77fb0ab5 |
monitor: Fix not dequeing TX packet properly
num_completed_packets_evt contain a count for how many packets have been
completed per handle. |
Luiz Augusto von Dentz |
2 years ago |
1 file, +4, -2 |
| 5d090ddc |
monitor: Consolidate code around latency calculation
This move latency calculations to a helper function called
packet_latency_add so it can get reused by the likes of l2cap.c and
analyze.c |
Luiz Augusto von Dentz |
2 years ago |
4 files, +51, -100 |
| 9a657dce |
monitor: Update documentation
This updates the documentation to mention gnuplot usage. |
Luiz Augusto von Dentz |
2 years ago |
2 files, +6, -1 |
| ac04b56c |
monitor: Use gnuplot to plot graph of Latency-Packets
This make use of gnuplot when using -a/--analyze to plot a graph of
Latency-Packets:
Found BR-ACL connection with handle 256
Address: XX:XX:XX:XX:XX:XX (Sony Home Entertainment&Sound Products Inc)
60 RX packets
22548 TX packets
22547 TX completed packets
3 msec min latency
73 msec max latency
11 msec median latency
6 octets TX min packet size
850 octets TX max packet size
847 octets TX median packet size
10000 +-+----------------------------------------------------------------+
+| ++ |
+| ||+ Packets +-----+ |
+| ||| |
1000 +-| |||++ |
+| ||||| + |
+| |||||++| |
+| ||||||||+++ |
100 +-| ||||||||||| + |
+| |||||||||||+++ + |
+| |||||||||||||| | |
+| ++ ||||||||||||||++|+ |
| || |||||||||||||||||++ |
10 +-| || |||||||||||||||||||+ |
+| || |||||||||||||||||||| + |
+| || ++||||||||||||||||||||++|++++ + |
| || ||||||||||||||||||||||||||||| | |
1 +-| ||+||||||||||||||||||||||||||||| + + | + |
++----------------------------------------------------------------+
+ + + + + + + + +
0 10 20 30 40 50 60 70 80
Latency (ms) |
Luiz Augusto von Dentz |
2 years ago |
1 file, +87, -11 |
| cda5549f |
gatt-client: Add read-only handles to dbus
This can be usefull when mapping names for services and characteristics
to their handle numbers. |
Simon Mikuda |
2 years ago |
2 files, +39, -0 |
| 828bc564 |
advertising: Fix peripheral adverts when Discoverable = false
There is a problem with this configuration: Type = peripheral,
Discoverable = false and Adapter is discoverable
In this state device will start advertise discoverable advertisements
even when user wanted non-discoverable advertisements.
This change will add empty Flags when "Discoverable" parameter is set. |
Simon Mikuda |
2 years ago |
1 file, +2, -6 |
| 16c1166d |
adapter: Fix generating IRK for adapter with privacy enabled
When root folder for adapter doesn't exist we will get this runtime error:
src/adapter.c:generate_and_write_irk() Unable set contents for
/var/lib/bluetooth/00:00:00:00:00:00/identity:
(Failed to create file “/var/lib/bluetooth/00:00:00:00:00:00/identity.EKQ581”:
No such file or directory) |
Simon Mikuda |
2 years ago |
1 file, +1, -0 |
| c7276fa7 |
bap: Fix memory leaks
This fixes the following memory leaks on exit:
g32 bytes in 1 blocks are definitely lost in loss record 170 of 800
g at 0x484182F: malloc (vg_replace_malloc.c:431)
g by 0x47C942: util_malloc (util.c:46)
g by 0x47AD6A: queue_new (queue.c:47)
g by 0x379CB6: bap_data_new (bap.c:1565)
g by 0x379E24: bap_probe (bap.c:1757)
g by 0x4048F3: service_probe (service.c:153)
g by 0x4190D5: probe_service (device.c:4817)
g by 0x41927D: dev_probe (device.c:4836)
g by 0x403918: btd_profile_foreach (profile.c:740)
g by 0x421861: device_probe_profiles (device.c:4896)
g by 0x3E5023: probe_devices (adapter.c:4590)
g by 0x498022F: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.7600.4)
g
g64 bytes in 2 blocks are definitely lost in loss record 556 of 800
g at 0x484182F: malloc (vg_replace_malloc.c:431)
g by 0x47C942: util_malloc (util.c:46)
g by 0x47AD6A: queue_new (queue.c:47)
g by 0x379CB6: bap_data_new (bap.c:1565)
g by 0x37DEA7: bap_adapter_probe (bap.c:1843)
g by 0x3CDB51: probe_profile (adapter.c:5066)
g by 0x403918: btd_profile_foreach (profile.c:740)
g by 0x3F557E: adapter_register (adapter.c:9288)
g by 0x3F557E: read_info_complete (adapter.c:10186)
g by 0x480D91: request_complete (mgmt.c:306)
g by 0x484466: can_read_data (mgmt.c:394)
g by 0x4ED93F: watch_callback (io-glib.c:157)
g by 0x496348B: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.7600.4) |
Luiz Augusto von Dentz |
2 years ago |
1 file, +1, -0 |
| 4d714bec |
shared/vcp: Reserve one more handle in VCS for VOCS
Fix: As per specs, VOCS is a secondary service;
hence it should be included under a primary service VCS.
The current number of handles is increased to accommodate the
included service |
Nitin Jadhav |
2 years ago |
1 file, +1, -1 |
| 2a0e392b |
shared/vcp: Fix issues of audio location and descriptor
Issues
- Audio output descriptor & location read functions requires code
correction.
- During reading audio location descriptor value was checked
instead of the pointer. DBG statement wrongly accessed value
to print the log that caused the crash.
Fix
- Corrected audio output descriptor read variable
- Corrected the audio location debug printing function
- Allocated the memory as a char pointer to the audio descriptor variable.
- Corrected the audio descriptor pointer checking condition |
Nitin Jadhav |
2 years ago |
1 file, +22, -19 |
| 06ec4f61 |
shared/vcp: Fix the crash observed with VOCS
Root cause
- There are two types of database- Remote and Local (rdb and ldb).
- In client mode currently the code was written to access ldb.
Fix
- Correcting it, to access rdb has resolved the problem in VOCS.
- Same correction is done for VCS.
Reported-by: Pauli Virtanen <pav@iki.fi> |
Nitin Jadhav |
2 years ago |
1 file, +2, -2 |
| d8ca0663 |
btmon: Make BIG identifier consistent
Bluetooth spec uses BIG Handle as a BIG identifier.
Btmon sometimes use this and sometimes BIG ID.
This patch makes code consistent |
Łukasz Rymanowski |
2 years ago |
2 files, +4, -4 |
| aee361c8 |
btmon: Fix obvious typo |
Łukasz Rymanowski |
2 years ago |
1 file, +1, -1 |
| cc9f3a8e |
monitor: Fix invalid Create BIG Test command
As per Bluetooth Core 5.4 Vol 4 Part E, 7.8.104,
max pdu is 2 octect long and there is no adv_handle before encyption
flag |
Grzegorz Kolodziejczyk |
2 years ago |
1 file, +1, -2 |
| 4337eb25 |
monitor: Fix adv_handle size in the set info transfer packet
As per Bluetooth Core 5.4 Vol 4. Part E, 7.8.90,
adv_handle is 1 octet size and not 2. |
Jakub Tyszkowski |
2 years ago |
1 file, +1, -1 |