Pauli Virtanen [Sat, 11 Feb 2023 19:55:53 +0000 (19:55 +0000)]
media: clear the right transport when clearing BAP endpoint
Each configured BAP stream is associated with a transport, and only that
transport should be cleared when the stream's configuration is cleared.
This is required for multiple BAP clients to use the same Media1
endpoint, which is what we should aim for to follow the spirit in which
the endpoints work in ASCS. Sound servers generally can handle this,
since the *Configuration calls provide the transport paths, and for
different clients they are associated with different devices.
Pauli Virtanen [Sat, 11 Feb 2023 19:55:52 +0000 (19:55 +0000)]
shared/bap: fix local endpoint state to be per-client
ASCS v1.0 Sec. 4.1: "For each ASE characteristic (distinguished by their
attribute handles), the server shall expose separate ASE characteristic
values for each client." In shared/bap.c, the ASE chrc value is
contained in bt_bap_endpoint struct.
As implemented currently, the same local ASE chrc value is shared
between all clients, in contradiction with the above. Namely, the
bt_bap_endpoint is looked up based on the gatt_db_attribute handles, in
bap_get_endpoint and bap_get_endpoint_id, but the handles correspond to
the ASCS registrations, and do not depend on which client is in
question.
Fix this by moving the endpoint states to the bt_bap BAP session struct,
so that the ASE state is associated with the sessions, and each session
has separate state.
Pauli Virtanen [Wed, 1 Feb 2023 19:51:47 +0000 (19:51 +0000)]
media: set default value for BAP endpoint Vendor field
The "Vendor" field is optional, and should have an initialized valid
default value.
It has the default values in register_endpoint, but not in
app_register_endpoint, so make the latter match the former.
Luiz Augusto von Dentz [Mon, 23 Jan 2023 23:56:49 +0000 (15:56 -0800)]
media: Rework support of Vendor to use uint32_t as type
This reworks the handlings of Vendor property to use a single uint32_t.
Luiz Augusto von Dentz [Mon, 23 Jan 2023 23:56:48 +0000 (15:56 -0800)]
media-api: Make Vendor a uint32_t
Using two uint16_t requires the use of a container which makes things a
lot more complicated so this switch to use a single uint32_t.
Luiz Augusto von Dentz [Mon, 23 Jan 2023 23:56:47 +0000 (15:56 -0800)]
shared/util: Check arguments on util_memcpy
This avoids having to check for !src or !len before calling util_memcpy
since otherwise it can cause runtime errors.
Abhay Maheta [Mon, 23 Jan 2023 23:56:46 +0000 (15:56 -0800)]
client/player: Add support for Company ID, Vendor ID
This adds support for Company ID and Vendor Codec ID in BAP profile.
This also adds handling of Vendor Specific Coding format for BAP
Profile.
Now it allows to enter zero codec capabilities for vendor codec.
In order to register zero codec capabilities, 0 shall be
entered when prompted.
Maheta, Abhay [Mon, 23 Jan 2023 23:56:45 +0000 (15:56 -0800)]
profiles: Add Support for Metadata, CID and VID
This adds support for Metadata, Company ID and Vendor Codec ID
Sam James [Tue, 31 Jan 2023 05:52:58 +0000 (05:52 +0000)]
shared: define MAX_INPUT for musl
musl systems don't have MAX_INPUT. Just define it to _POSIX_MAX_INPUT
which musl does have if it's not already defined.
Note that on glibc, the values match anyway (as of glibc-2.36), and
indeed POSIX_MAX_INPUT has the same value on musl too.
Bug: https://bugs.gentoo.org/888467
Brian Gix [Tue, 24 Jan 2023 20:22:16 +0000 (12:22 -0800)]
mesh: Remove unused byte swap for ScanBuild
Brian Gix [Tue, 24 Jan 2023 19:24:23 +0000 (11:24 -0800)]
mesh: Fix Checksmatch warning
Brian Gix [Fri, 9 Apr 2021 15:45:24 +0000 (08:45 -0700)]
mesh: Switch beaconing net key
When transitioning from Phase 1 to Phase 2 of a network key and we are
beaconing, we need to halt the beaconing on the old key version, and
begin beaconing on the new key version.
Brian Gix [Thu, 8 Oct 2020 18:10:59 +0000 (11:10 -0700)]
tools/mesh: Add support for Mesh Private Beacons
This allows generation of Mesh Private Beacon server commands, and
recognition of the resulting Status messages.
Brian Gix [Thu, 8 Oct 2020 18:05:47 +0000 (11:05 -0700)]
mesh: Add internal Mesh Private Beacon model
Adds recgnition that the Mesh Private Beacon model is internal
and foundational, without bindings.
Brian Gix [Thu, 8 Oct 2020 17:44:59 +0000 (10:44 -0700)]
mesh: Add Tx/Rx support of Mesh Private Beacons
With this change, we start evaluating received Mesh Private Beacons in
addition to the legacy Secure Network Beacons. We also add the ability
to request Tx of Mesh Private Beacons, which are regenerated with new
Random Nonce a minimum of every 0 - 2550 seconds.
Brian Gix [Thu, 8 Oct 2020 17:32:36 +0000 (10:32 -0700)]
mesh: Add Mesh Private Beacon server
This initial server supports only the Mesh Private Beacon and returns
"Not Suppoerted" for Get/Set of Private GATT Proxy and Private Node
Identity beacons.
Brian Gix [Thu, 8 Oct 2020 17:59:48 +0000 (10:59 -0700)]
mesh: Add storage of Mesh Private Beacon settings
If current storage does not exist in node.json, the Mesh Private
Beacon will be disabled.
Brian Gix [Thu, 8 Oct 2020 18:09:30 +0000 (11:09 -0700)]
unit/mesh: Add unit testing of Mesh Private Beaconing
This includes the Sample Data from the Mesh Profile specification v1.1,
and validates that the beacon crypto functions work as expected.
Brian Gix [Tue, 29 Sep 2020 20:45:49 +0000 (13:45 -0700)]
mesh: Rename parameter list per crypto usage
The derived key generated by the "nkpk" salt and network master key is
used to create Private Beacons as of Mesh Profile Specification v1.1
Brian Gix [Tue, 25 Oct 2022 21:34:40 +0000 (14:34 -0700)]
tools/mesh: Optimize for multiple RPR servers and NPPI
These changes allow the mesh-cfgclient tool to request remote node
compositions from page 128. Depending on the differences between
there and what is stored in the local configuration database, it may
recomend reprovisioning with NPPI-1 (Address Refresh) or NPPI-2
(Composition Refresh).
Additionally, NPPI-0 may be performed to refresh the Device Key only.
Brian Gix [Tue, 25 Oct 2022 21:33:48 +0000 (14:33 -0700)]
mesh: Add Remote Provisioning
Add Remote Provisioning Server
Add Remote Provisioning Client
Remove local scanning/provisioning
Add delete-all dev key function
Add NPPI procedures
Brian Gix [Fri, 1 May 2020 17:46:26 +0000 (10:46 -0700)]
doc/mesh: Add Remote Provisioning DBus APIs
Remote Provisioning (introduced in Mesh Profile Specification v1.1)
* Allows Provisioners to use a remote server to scan for and
provision devices.
* Allows Config managers to reprovision existing nodes to:
* Refresh Device Keys
* Reassign Node Addresses
* Refresh Node Composition
Brian Gix [Tue, 24 Jan 2023 22:02:03 +0000 (14:02 -0800)]
AUTHORS: modify Brian Gix email address
Marcin Kraglak [Mon, 30 Jan 2023 09:13:36 +0000 (10:13 +0100)]
monitor/att: Fix Set Member Lock decoding
According to CSIS specification v1.0.1: "Allowed values for the Set
Member Lock characteristic are Unlocked (corresponding to the
numeric value 0x01) and Locked (corresponding to the numeric
value 0x02); all other values are RFU".
Marcin Kraglak [Sat, 28 Jan 2023 06:37:33 +0000 (07:37 +0100)]
AUTHORS: Update Marcin's email
Marcin Kraglak [Sat, 28 Jan 2023 06:37:32 +0000 (07:37 +0100)]
shared/util: Add CAS, HAS, TMAS and PBAS UUIDs
Add UUIDs for: Common Audio service, Hearing Aid service,
TMAS service and Public Broadcast Announcement service.
Luiz Augusto von Dentz [Thu, 26 Jan 2023 20:10:13 +0000 (12:10 -0800)]
bap: Fix registering multiple endpoint for the same PAC set
This makes sure there is only one endpoint representing a local and
remote PAC set.
Luiz Augusto von Dentz [Thu, 26 Jan 2023 00:04:01 +0000 (16:04 -0800)]
bap: Fix not checking if request fits when grouping
When grouping requests with the same opcode the code was queueing them
without attempt to check that that would fit in the ATT MTU causing the
following trace:
stack-buffer-overflow on address 0x7fffdba951f0 at pc 0x7fc15fc49d21 bp
0x7fffdba95020 sp 0x7fffdba947d0
WRITE of size 9 at 0x7fffdba951f0 thread T0
#0 0x7fc15fc49d20 in __interceptor_memcpy
(/lib64/libasan.so.8+0x49d20)
#1 0x71f698 in util_iov_push_mem src/shared/util.c:266
#2 0x7b9312 in append_group src/shared/bap.c:3424
#3 0x71ba01 in queue_foreach src/shared/queue.c:207
#4 0x7b9b66 in bap_send src/shared/bap.c:3459
#5 0x7ba594 in bap_process_queue src/shared/bap.c:351
Fixes: https://github.com/bluez/bluez/issues/457#issuecomment-
1403924708
Luiz Augusto von Dentz [Tue, 24 Jan 2023 23:45:39 +0000 (15:45 -0800)]
bap: Fix not removing endpoint if local PAC is unregistered
If local PAC is unregistered it would also notify via pac_removed
callback which shall unregister the endpoint D-Bus object.
Fixes: https://github.com/bluez/bluez/issues/457#issuecomment-
1402178691
Luiz Augusto von Dentz [Mon, 23 Jan 2023 21:27:14 +0000 (13:27 -0800)]
bap: Fix not setting stream to NULL
If the stream state is idle the ep->stream shall be set to NULL
otherwise it may be reused causing the following trace:
==32623==ERROR: AddressSanitizer: heap-use-after-free on address ...
READ of size 8 at 0x60b000103550 thread T0
#0 0x7bf7b7 in bap_stream_valid src/shared/bap.c:4065
#1 0x7bf981 in bt_bap_stream_config src/shared/bap.c:4082
#2 0x51a7c8 in bap_config profiles/audio/bap.c:584
#3 0x71b907 in queue_foreach src/shared/queue.c:207
#4 0x51b61f in select_cb profiles/audio/bap.c:626
#5 0x4691ed in pac_select_cb profiles/audio/media.c:884
#6 0x4657ea in endpoint_reply profiles/audio/media.c:369
Fixes: https://github.com/bluez/bluez/issues/457#issuecomment-
1399232486
Luiz Augusto von Dentz [Mon, 23 Jan 2023 21:06:07 +0000 (13:06 -0800)]
shared/bap: Fix not detaching streams when PAC is removed
When local PAC is removed we attempt to release the streams but we left
it still attached to the endpoint, so this makes sure the stream is
properly detached by setting its state to idle.
Fixes: https://github.com/bluez/bluez/issues/457
Abhay Maheta [Fri, 13 Jan 2023 05:06:05 +0000 (10:36 +0530)]
shared/bap: Fixing Company ID and Vendor ID endianess
This fixes Company ID and Vendor Codec ID which are supposed to be
little endian.
Luiz Augusto von Dentz [Fri, 13 Jan 2023 21:15:21 +0000 (13:15 -0800)]
shared/bap: Fix scan-build warning
This fixes the following warning:
src/shared/bap.c:2268:26: warning: Access to field 'iov_len' results in
a dereference of a null pointer (loaded from variable 'cont')
return iov_append(data, cont->iov_len, cont->iov_base);
^~~~~~~~~~~~~
Luiz Augusto von Dentz [Fri, 6 Jan 2023 00:32:55 +0000 (16:32 -0800)]
shared/gatt-client: Fix smatch warnings
This fixes the following warnings:
shared/gatt-client.c:2764:33: warning: Variable length array is used.
shared/gatt-client.c:2994:23: warning: Variable length array is used.
shared/gatt-client.c:3075:23: warning: Variable length array is used.
shared/gatt-client.c:3514:23: warning: Variable length array is used.
Luiz Augusto von Dentz [Thu, 5 Jan 2023 22:01:57 +0000 (14:01 -0800)]
hog-lib: Fix not handling BT_ATT_OP_HANDLE_NFY_MULT
This is a temporary fix for not handling BT_ATT_OP_HANDLE_NFY_MULT in
GAttr so the code will use g_attrib_attach_client to attach the
bt_gatt_client instance which is then used to register notifications
including those sent with BT_ATT_OP_HANDLE_NFY_MULT.
Fixes: https://github.com/bluez/bluez/issues/71
Luiz Augusto von Dentz [Thu, 5 Jan 2023 21:59:20 +0000 (13:59 -0800)]
attrib: Introduce g_attrib_attach_client
This introduces g_attrib_attach_client which can be used to attach a
bt_gatt_client instance to GAttr so it can be used to register
notifications.
Luiz Augusto von Dentz [Thu, 5 Jan 2023 21:54:50 +0000 (13:54 -0800)]
shared/gatt-client: Allow registering with NULL callback
This makes bt_gatt_client_register_notify allow registering with NULL
callback which is interpreted as the CCC write has already been
performed therefore it won't be written again.
Luiz Augusto von Dentz [Thu, 5 Jan 2023 21:52:15 +0000 (13:52 -0800)]
shared/gatt-client: Use parent debug_callback if not set on clone
If clone don't have a dedicated callback set use its parent so users of
bt_gatt_client_clone don't have to keep setting the same callback for
all clone instances.
Abhay Maheta [Thu, 29 Dec 2022 15:53:01 +0000 (21:23 +0530)]
media-api: Add Vendor and Metadata
This adds Vendor and Metadata properties to MediaEndpoint1.
Abhay Maheta [Thu, 29 Dec 2022 15:52:55 +0000 (21:22 +0530)]
shared/bap: Fix handling for Company ID and Vendor Codec ID
This adds fixes for handing for Company ID and Vendor Codec ID
while adding PAC record to database and responding to Attribute
Read Request for Sink/Source PAC Characteristics.
Luiz Augusto von Dentz [Thu, 22 Dec 2022 21:41:12 +0000 (13:41 -0800)]
monitor: Add support for decoding RSI
This adds support for decoding Resolvable Set Identifier[1] advertising
type (0x2e) according to CIS[2] spec:
Resolvable Set Identifier: 46-BB-DB-26-D8-55
Hash: 0x26d855
Random: 0x46bbdb
[1] https://www.bluetooth.com/specifications/assigned-numbers/
[2] https://www.bluetooth.com/specifications/csis-1-0-1/
Luiz Augusto von Dentz [Wed, 21 Dec 2022 23:56:16 +0000 (15:56 -0800)]
test-crypto: Add /crypto/sef test
This adds test /crypto/sef which validas the implementation of
bt_crypto_sef using the sample data from CSIS[1] spec:
A.2. sef SIRK Encryption Function
> unit/test-crypto -s "/crypto/sef"
SIRK:
cd cc 72 dd 86 8c cd ce 22 fd a1 21 09 7d 7d 45 ..r....."..!.}}E
K:
d9 ce e5 3c 22 c6 1e 06 6f 69 48 d4 9b 1b 6e 67 ...<"...oiH...ng
Expected:
46 d3 5f f2 d5 62 25 7e a0 24 35 e1 35 38 0a 17 F._..b%~.$5.58..
Result:
46 d3 5f f2 d5 62 25 7e a0 24 35 e1 35 38 0a 17 F._..b%~.$5.58..
[1]https://www.bluetooth.com/specifications/csis-1-0-1/
Luiz Augusto von Dentz [Wed, 21 Dec 2022 22:15:26 +0000 (14:15 -0800)]
shared/crypto: Adds bt_crypto_sef
This adds bt_crypto_sef is is used to create a hash as stated on CSIS
spec:
'4.5. SIRK encryption function sef'
https://www.bluetooth.com/specifications/csis-1-0-1/
Luiz Augusto von Dentz [Tue, 20 Dec 2022 22:55:59 +0000 (14:55 -0800)]
test-crypto: Add /crypto/sih test
This adds test /crypto/sih which validas the implementation of
bt_crypto_sih using the sample data from CSIS[1] spec:
A.1. sih Resolvable Set Identifier hash function
> unit/test-crypto -s "/crypto/sih"
K:
cd cc 72 dd 86 8c cd ce 22 fd a1 21 09 7d 7d 45 ..r....."..!.}}E
R:
63 f5 69 c.i
Expected:
da 48 19 .H.
Result:
da 48 19 .H.
[1] https://www.bluetooth.com/specifications/csis-1-0-1/
Luiz Augusto von Dentz [Tue, 20 Dec 2022 22:52:10 +0000 (14:52 -0800)]
shared/crypto: Adds bt_crypto_sih
This adds bt_crypto_sih is is used to create a hash as stated on
CSIS[1] spec:
'4.7. Resolvable Set Identifier hash function sih'
https://www.bluetooth.com/specifications/csis-1-0-1/
Sathish Narasimman [Tue, 22 Nov 2022 10:12:31 +0000 (15:42 +0530)]
monitor/att: Add decoding support for CSIP
This adds decoding support for CSIS attributes:
> ACL Data RX: Handle 3585 flags 0x02 dlen 7
ATT: Read Request (0x0a) len 2
Handle: 0x0017 Type: Set Identity Resolving Key (0x2b84)
< ACL Data TX: Handle 3585 flags 0x00 dlen 22
ATT: Read Response (0x0b) len 17
Value:
01761fae703ed681f0c50b34155b6434fb
Handle: 0x0017 Type: Set Identity Resolving Key (0x2b84)
SIRK:
01761fae703ed681f0c50b34155b6434fb
> ACL Data RX: Handle 3585 flags 0x02 dlen 7
ATT: Read Request (0x0a) len 2
Handle: 0x001b Type: Set Member Lock (0x2b86)
< ACL Data TX: Handle 3585 flags 0x00 dlen 6
ATT: Read Response (0x0b) len 1
Value: 01
Handle: 0x001b Type: Set Member Lock (0x2b86)
Locked (0x01)
> ACL Data RX: Handle 3585 flags 0x02 dlen 7
ATT: Read Request (0x0a) len 2
Handle: 0x001e Type: Set Member Rank (0x2b87)
< ACL Data TX: Handle 3585 flags 0x00 dlen 6
ATT: Read Response (0x0b) len 1
Value: 01
Handle: 0x001e Type: Set Member Rank (0x2b87)
Rank: 0x01
Sathish Narasimman [Tue, 22 Nov 2022 10:12:27 +0000 (15:42 +0530)]
lib/uuid: Add CSIS UUIDs
This adds Coordinated Set Identification Service UUIDs which will
be used by Coordinated Set Identification Profile.
Sathish Narasimman [Tue, 22 Nov 2022 10:12:26 +0000 (15:42 +0530)]
shared/util: Update UUID database for Csip services
This updates UUID database with the values from assigned numbers for
co-ordinated set identification services.
Luiz Augusto von Dentz [Thu, 15 Dec 2022 23:26:20 +0000 (15:26 -0800)]
shared/gatt-client: Fix not removing pending services
If there are no characteristics to discover, or for some reason
bt_gatt_discover_descriptors is skiped, or the last attribute is
actually a included service the service should be removed from
pending list as there will be no more attributes to be discovered.
Fixes: https://github.com/bluez/bluez/issues/438
Luiz Augusto von Dentz [Sat, 17 Dec 2022 00:56:05 +0000 (16:56 -0800)]
shared/gatt-db: Add gatt_db_attribute_get_service
This adds gatt_db_attribute_get_service which can be used to get the
service which the given attribute belongs to.
Luiz Augusto von Dentz [Wed, 14 Dec 2022 21:45:20 +0000 (13:45 -0800)]
client/player: Fix transport.send/receice tab completion
Commands transport.send/receive were not settings any completion
callback so this makes sure it uses transport_generator to generate the
list of transport that could be used to send.
Luiz Augusto von Dentz [Wed, 14 Dec 2022 21:01:07 +0000 (13:01 -0800)]
client/player: Print transport progress
This uses bt_shell_echo to print out the transfer progress on the echo
area.
Luiz Augusto von Dentz [Wed, 14 Dec 2022 00:09:22 +0000 (16:09 -0800)]
client/player: Use bt_shell_echo to print transfer progress
This uses bt_shell_echo to print transfer progress.
Luiz Augusto von Dentz [Wed, 14 Dec 2022 00:07:56 +0000 (16:07 -0800)]
shared/shell: Add bt_shell_echo
This adds bt_shell_echo which can be used to print messages on the echo
area.
Luiz Augusto von Dentz [Mon, 12 Dec 2022 23:34:50 +0000 (15:34 -0800)]
client/player: Make transport.send non-blocking
This makes transport.send command non-blocking by using timerfd
callback to initiate the transfers.
Luiz Augusto von Dentz [Fri, 9 Dec 2022 21:19:17 +0000 (13:19 -0800)]
isotest: Fix not calculating time to wait
The difference of time start and current time may have advanced just
enough to add a second leaving start nanoseconds to be bigger.
Luiz Augusto von Dentz [Fri, 9 Dec 2022 17:44:41 +0000 (09:44 -0800)]
client/player: Fix not calculating time to wait
The difference of time start and current time may have advanced just
enough to add a second leaving start nanoseconds to be bigger.
Luiz Augusto von Dentz [Wed, 7 Dec 2022 21:49:24 +0000 (13:49 -0800)]
shared/bap: Make bt_bap_pac_register to be per session
This makes bt_bap_pac_register to be per session rather than global so
the callback don't have to match the session by itself.
Luiz Augusto von Dentz [Thu, 8 Dec 2022 01:21:02 +0000 (17:21 -0800)]
shared/gatt-db: Allow passing NULL to gatt_db_attribute_write
This makes gatt_db_attribute_write to accept NULL as a func when
storing directly on the db itself.
Luiz Augusto von Dentz [Thu, 8 Dec 2022 01:12:03 +0000 (17:12 -0800)]
shared/bap: Read PAC Sink/Source if respective location is found
If PAC Sink/Source has been found but not record has been recovered it
means an error must have occurred so this attempt to read the records
once again.
Luiz Augusto von Dentz [Tue, 6 Dec 2022 00:46:32 +0000 (16:46 -0800)]
shared/bap: Log error message if request cannot be sent
This makes sure a error message is logged if a request cannot be sent
for some reason.
Luiz Augusto von Dentz [Mon, 5 Dec 2022 23:41:34 +0000 (15:41 -0800)]
shared/att: Fix not requeueing in the same channel
If request needs to be resend due to change in the security use the
chan->queue otherwise it may end up using a different channel.
Luiz Augusto von Dentz [Wed, 7 Dec 2022 00:44:51 +0000 (16:44 -0800)]
iso-tester: Add test when peer rejects CIS
This adds the following test for testing when remote stack rejects the
CIS:
ISO Connect - Reject Passed
Luiz Augusto von Dentz [Tue, 6 Dec 2022 21:31:58 +0000 (13:31 -0800)]
bthost: Add callback to accept ISO connections
This enables setting an accept callback which can return reject
reason if the connection shall not be accepted.
Luiz Augusto von Dentz [Mon, 5 Dec 2022 22:26:17 +0000 (14:26 -0800)]
client: Allow gatt.select-attribute to work with local attributes
This allows gatt.select-attribute local to select from the registered
attributes:
[bluetooth]# gatt.select-attribute local /org/bluez/app/service0/chrc0
[/org/bluez/app/service0/chrc0]# gatt.write 0x01
[CHG] Attribute /org/bluez/app/service0/chrc0 (%UUID) written
[/org/bluez/app/service0/chrc0]# gatt.read
01 .
[/org/bluez/app/service0/chrc0]# gatt.select-attribute local
/org/bluez/app/service0/chrc1
[/org/bluez/app/service0/chrc1]# gatt.write 0x01
[CHG] Attribute /org/bluez/app/service0/chrc1 (%UUID) written
[/org/bluez/app/service0/chrc1]# gatt.read
01 .
[/org/bluez/app/service0/chrc1]#
Luiz Augusto von Dentz [Sat, 3 Dec 2022 00:04:43 +0000 (16:04 -0800)]
monitor/att: Fix crash when accessing packet_conn
This fixes the following crash:
:monitor/att.c:2697:11: runtime error: member access within null
pointer of type 'struct att_conn_data'
Allen Webb [Thu, 1 Dec 2022 18:48:48 +0000 (12:48 -0600)]
bluetooth.ver: Export sanitizer symbols
Fix llvm sanitizer support by not hiding sanitizer related symbols.
Luiz Augusto von Dentz [Thu, 1 Dec 2022 00:04:05 +0000 (16:04 -0800)]
client: Move common print_* functions to its own file
This move common print_* functions to its own file so they can be
properly reused instead of duplicating the code.
Luiz Augusto von Dentz [Wed, 30 Nov 2022 22:20:14 +0000 (14:20 -0800)]
bap: Fix not waiting Endpoint.SelectProperties
If there are multiple Endpoint.SelectProperties wait them to complete
before attempting to proceed to configure a stream otherwise streams
may not be linked properly and may end up creating multiple CIS
instead.
Luiz Augusto von Dentz [Thu, 20 Oct 2022 23:53:12 +0000 (16:53 -0700)]
shared/bap: Merge PAC records of the same type/codec
This attempts to merge PAC records which contain the same type and
codec to simplify the matching with client endpoints so all
capabilities and metadata are match at once instead of for each PAC
record.
Luiz Augusto von Dentz [Tue, 29 Nov 2022 01:08:27 +0000 (17:08 -0800)]
media: Fix crash when transport configuration changes
In case of BAP the same transport may be reconfigured multiple times
which means it would appears multiple times on endpoint->transports
leading to a crash when disconnecting as the code would attempt to
destroy the same object multiple times.
Luiz Augusto von Dentz [Mon, 28 Nov 2022 23:31:28 +0000 (15:31 -0800)]
bap: Fix not able to reconfigure
While attempting to configure QoS setting the request id is not reset
to 0 when a response is received which prevents any the QoS to be
reconfigured.
Luiz Augusto von Dentz [Wed, 23 Nov 2022 23:27:36 +0000 (15:27 -0800)]
client/player: Add support for custom preset
This adds support for a custom preset which asks the user to enter its
configuration:
[bluetooth]# endpoint.presets
00002bc9-0000-1000-8000-
00805f9b34fb custom
[Codec] Enter frequency (Khz): 48
[Codec] Enter frame duration (ms): 10
[Codec] Enter channel allocation: 0x000000003
[Codec] Enter frame length: 100
[QoS] Enter Target Latency (Low, Balance, High): Low
[QoS] Enter SDU Interval (us): 10000
[QoS] Enter Framing (Unframed, Framed): Unframed
[QoS] Enter PHY (1M, 2M): 2M
[QoS] Enter Max SDU: 200
[QoS] Enter RTN: 3
[QoS] Enter Max Transport Latency (ms): 20
[QoS] Enter Presentation Delay (us): 10000
Luiz Augusto von Dentz [Wed, 16 Nov 2022 00:09:32 +0000 (16:09 -0800)]
shared/bap: Fix initiating QoS and Enable procedures as server
According to Table 3.2: ASE state machine transition these procedures
can only be initated by clients.
Luiz Augusto von Dentz [Tue, 15 Nov 2022 19:17:18 +0000 (11:17 -0800)]
shared/bap: Fix not reading all instances of PAC Sinks/Sources
Both PAC Sink and Source are allowed to have multiple instances:
- The server wanted to support a smaller maximum transmission unit
(ATT_MTU, as defined in Volume 3, Part F, Section 3.2.8 in [2]) size.
Exposing all supported PAC records in a single Sink PAC characteristic
would require the server to increase its supported Maximum
Transmission Unit (MTU) size to a value the server considered
excessive.
- The server wanted to expose support for proprietary audio
capabilities (such as vendor-specific audio codecs, as denoted by the
Codec_ID parameter value) separately from support for
non-vendor-specific audio capabilities and used separate Sink PAC
characteristics to expose such support.
- The server wanted to minimize the amount of data to be transferred,
when sending notifications to a client that the Sink PAC
characteristic value changed, by exposing the audio capabilities
likely to change quicker than others in separate Sink PAC
characteristics.
Luiz Augusto von Dentz [Thu, 1 Dec 2022 01:45:09 +0000 (17:45 -0800)]
shared/gatt-client: Fix not checking valid ranges
When attempting to update discovery ranges the code shall verify if the
range is still valid (handles != 0x0000 and start < end).
Luiz Augusto von Dentz [Wed, 16 Nov 2022 21:15:56 +0000 (13:15 -0800)]
monitor: Decode vendor codecs of BT_HCI_CMD_READ_LOCAL_CODECS_V2
This attempts to decode the vendor codecs includec in the response of
BT_HCI_CMD_READ_LOCAL_CODECS_V2.
Simon Mikuda [Fri, 18 Nov 2022 05:26:10 +0000 (06:26 +0100)]
main.conf: Add SecureConnections option
This introduces SecureConnections option to main.conf that can be used to
configure this on adapter initialization.
This is useful for:
- disable for adapters that have a problems with SecureConnections enabled
- if you want to disable CTKD (cross transport key derivation)
- add option to enable only SecureConnections
Luiz Augusto von Dentz [Mon, 21 Nov 2022 21:01:46 +0000 (13:01 -0800)]
client/player: Fix scan-build warning
This fixes the following warning:
client/player.c:1775:25: warning: Dereference of null pointer
[core.NullDereference]
iov_append(&cfg->caps, preset->data.iov_base, preset->data.iov_len);
^~~~~~~~~~~~~~~~~~~~~
Brian Gix [Thu, 17 Nov 2022 20:21:50 +0000 (12:21 -0800)]
tools: Use portable 64 bit data formats
The isotest executable was using the non-portable %zd string formatter
for loging 64 bit integers. This replaces them with PRId64.
Bastien Nocera [Wed, 9 Nov 2022 15:17:56 +0000 (16:17 +0100)]
hostname: Fallback to transient hostname
After pretty hostname, and static hostname, also support transient
hostname as a last resort before 'BlueZ X.XX'.
This happens on Fedora's Workstation installation as it calls
"hostnamectl set-hostname" on startup. In Fedora Silverblue, the default
hostname is set as fedora in /etc/os-release.
In both cases, we should fall back to that transient hostname, as bad as
it could be.
Note that the transient hostname needs to be monitored through the
kernel directly, as explained in:
https://www.freedesktop.org/software/systemd/man/org.freedesktop.hostname1.html
Bastien Nocera [Wed, 9 Nov 2022 15:17:55 +0000 (16:17 +0100)]
hostname: Add '' around printed strings
Otherwise we can't see whether the string is nul, or empty.
Luiz Augusto von Dentz [Thu, 3 Nov 2022 21:59:51 +0000 (14:59 -0700)]
unit: Introduce test-bap
Test Summary
------------
BAP/UCL/DISC/BV-01-C Passed
BAP/UCL/DISC/BV-02-C Passed
BAP/UCL/DISC/BV-06-C Passed
BAP/UCL/DISC/BV-05-C Passed
BAP/UCL/DISC/BV-03-C Passed
BAP/UCL/DISC/BV-04-C Passed
Total: 6, Passed: 6 (100.0%), Failed: 0, Not Run: 0
Luiz Augusto von Dentz [Wed, 9 Nov 2022 21:02:49 +0000 (13:02 -0800)]
shared/bap: Fix crash when canceling requests
If bt_bap_unref/bap_free is called while there is an ongoing pending
request it may endup calling into bap_notify_ready which will try to
notify ready callbacks while holding a reference, but in case the
reference is already 0 that means it would switch to 1 and back 0
causing a double free.
To prevent that bap_notify_ready now checks that the reference is not 0
with use of bt_bap_ref_safe.
Luiz Augusto von Dentz [Wed, 9 Nov 2022 21:00:47 +0000 (13:00 -0800)]
shared/tester: Add tester_io_set_complete_func
This adds tester_io_set_complete_func which can be used to set a
callback when all iovec has been sent/received.
Luiz Augusto von Dentz [Fri, 11 Nov 2022 22:29:42 +0000 (14:29 -0800)]
shared/bap: Make use of util_iov helpers
This make use of util_iov helpers instead of reimplementing them.
Luiz Augusto von Dentz [Wed, 9 Nov 2022 20:59:13 +0000 (12:59 -0800)]
shared/util: Add iovec helpers
This adds iovec helpers functions.
Luiz Augusto von Dentz [Fri, 11 Nov 2022 23:48:30 +0000 (15:48 -0800)]
monitor/att: Fix not dequeing att_read on error response
If a read/read by type fails it needs to be dequeued otherwise it can
cause the next operation of the same type to return the wrong request
and possible decoding as if it was a different attribute type.
Wootak Jung [Tue, 12 Dec 2023 02:17:48 +0000 (11:17 +0900)]
gdbus/object: Fix issue where the 'Powered' property changed was not emitted
property changed should be emitted after interface is published.
Change-Id: Ibaf34eec7e804a0943e8647285c8da28ef65571a
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Mon, 11 Dec 2023 01:27:49 +0000 (10:27 +0900)]
shared/att: Fix mtu not updated issue
Reproduction steps:
1. gatt connected
2. request to the remote with mtu 517
3. when getting mtu, 517 returned
4. mtu 512 changed received from the remote
5. when getting mtu, 517 returned. (Should be 512)
Change-Id: Ic2c6b19690d7da7572762083ab9577cb3b9e0e97
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Mon, 11 Dec 2023 04:57:24 +0000 (04:57 +0000)]
Merge "Add support for A2DP source and sink both role" into tizen
Wootak Jung [Fri, 8 Dec 2023 00:41:55 +0000 (09:41 +0900)]
Add new DA model name
AI Hub Smart EHS
Change-Id: I631ffa40c73041c6ad4aab1f47859a7c0a5c8fd9
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Tue, 28 Nov 2023 05:51:49 +0000 (14:51 +0900)]
Fix the security vulnerability issue
A variant of this attack works when bluetoothctl shows that bluetooth is
discoverable, pariable, and discovering (only a subset may be necessary). On
Ubuntu 22.04 Desktop this becomes true when the GNOME panel for
bluetooth settings is opened.
BlueZ's setting ClassicBondedOnly=true prevents this attack.
This parameter is not enabled in CVE-2020-0556 patches and all distros
I checked have not opted into this setting. Most members of the distros list
are likely affected.
Change-Id: Ib4883d1766d314bcd415308a9e4805e196462f3a
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Mon, 27 Nov 2023 00:11:36 +0000 (09:11 +0900)]
Add new DA model names
Bespoke Washer
Bespoke Dryer
Appliance Emulator
Change-Id: Id57796968c980e43f8c552aa22f670eb6b3bdf6e
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Wed, 15 Nov 2023 04:21:54 +0000 (13:21 +0900)]
Add support for A2DP source and sink both role
- Change DefaultA2DPRoleSink to DefaultA2DPRole
- Enable both role in DA devices
Change-Id: I51c2a083f55e220d3430723e11d1af61de4fa4b7
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Wed, 18 Oct 2023 07:54:13 +0000 (16:54 +0900)]
src/device.c: Fix crash issue during bonding
Usage of rpa_addr and rpa is mixed during upgrade
src/adapter.c:bonding_attempt_complete() hci0 bdaddr 94:8B:C1:14:D4:9B type 0 status 0x0
src/device.c:device_bonding_complete() bonding (nil) status 0x00
src/adapter.c:mgmt_debug() src/shared/mgmt.c:can_read_data() [0x0000] event 0x0018
src/adapter.c:new_irk_callback() hci0 new IRK for 94:8B:C1:14:D4:9B RPA 00:00:00:00:00:00
Jan 01 09:09:37 localhost audit[4350]: ANOM_ABEND auid=
4294967295 uid=551 gid=551 ses=
4294967295 subj=System pid=4350 comm="bluetoothd" exe="/usr/libexec/bluetooth/bluetoothd" sig=11 res=1
Change-Id: I4b67e1fe2728391fe8cb3339e7784748d00861a0
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Fri, 13 Oct 2023 01:10:53 +0000 (10:10 +0900)]
main.conf: Change the TemporaryTimout value to 180
temporary devices will be removed after 180s not 30s
Change-Id: I6741644d7dd1df7d7ea885e7750600ec5614e93e
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Fri, 6 Oct 2023 08:14:01 +0000 (17:14 +0900)]
adapter: Fix an issue of function infinite repetition
src/adapter.c:adapter_remove_connection()
src/adapter.c:adapter_remove_connection() isPaired 0, isBonded 0
src/adapter.c:adapter_remove_connection() Removing temporary device /org/bluez/hci0/dev_00_02_33_A9_E7_F6
src/adapter.c:adapter_remove_connection() addr type 0, bonded
src/adapter.c:adapter_remove_connection()
src/adapter.c:adapter_remove_connection() isPaired 0, isBonded 0
src/adapter.c:adapter_remove_connection() Removing temporary device /org/bluez/hci0/dev_00_02_33_A9_E7_F6
src/adapter.c:adapter_remove_connection() addr type 1, bonded
src/adapter.c:adapter_remove_connection()
src/adapter.c:adapter_remove_connection() isPaired 0, isBonded 0
src/adapter.c:adapter_remove_connection() Removing temporary device /org/bluez/hci0/dev_00_02_33_A9_E7_F6
src/adapter.c:adapter_remove_connection() addr type 0, bonded
...
Change-Id: Idb12627837b9ac38e15bed27610b7b482e549607
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Jonghwa Lee [Fri, 25 Nov 2022 06:03:11 +0000 (15:03 +0900)]
Separate bluez-test package into tests and tools
Currently, bluez-test package contains both test programs
and bluez's configuration tools. Because of test scripts
in the pacakge, it has a dependancy to 'dbus-python' which
is not neeeded for other tools in the same package.
By separating of tools from the package, it can become more
deployable.
Change-Id: Id2edb654e2c963a1ba5fc2248acace8d32a732e9
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Wootak Jung [Mon, 7 Aug 2023 00:24:11 +0000 (09:24 +0900)]
Add new DA model names
Change-Id: I411e8ef51a3dafd0cc583ff8da2c6111dbbf99a0
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>