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>
Anuj Kumar Singh [Thu, 13 Jul 2023 11:04:06 +0000 (16:34 +0530)]
Resolve build warning.
Change-Id: I59f385b09361646e074609426f48900ee6fda6dd
Signed-off-by: Anuj Kumar Singh <anujk.singh@samsung.com>
Wootak Jung [Thu, 6 Jul 2023 05:59:20 +0000 (14:59 +0900)]
gatt-database: Add OCF service handling logic
1. invalid handle issue
For bluez, the handle increases whenever service is added.
Invalid handle error occurs because mobile caches the handle for paired remote
device. Modify to use reserved handle for ocf uuid.
2. service persistence issue
Mobile is caching without service if gatt connection is lost while service is
removed.
Modify service changed notification not to be delivered for ocf service.
Change-Id: Ie77a21a7828251dbfd42a9b8749188c4696a819b
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Mon, 3 Jul 2023 01:18:47 +0000 (10:18 +0900)]
Fix build error using gcc 13
Change-Id: I66167a2f197d294d241d27799c259bda47bf6bda
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Wootak Jung [Thu, 29 Jun 2023 23:47:18 +0000 (08:47 +0900)]
Fixed the build error using gcc 13
Change-Id: I11ddcfd23d8d0c883b87c530e127a0ec5b8afd0d
Wootak Jung [Thu, 8 Jun 2023 00:44:21 +0000 (09:44 +0900)]
Add "Smart Cooktop" to DA model
Change-Id: Ib62cbde072f59918b69465837fc605ef844a6629
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Anuj Jain [Mon, 5 Jun 2023 09:08:29 +0000 (14:38 +0530)]
Fix the 64bit build error
Change-Id: If2eb25d701bfe3167150c42744e554736e3e0504
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Ayush Garg [Mon, 15 May 2023 08:34:35 +0000 (14:04 +0530)]
Update bluez version to 5.66 in spec file
Change-Id: I9e827b4df00f57c6b0e70a94e3fdb444efe1e5a6
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Thu, 10 Nov 2022 20:22:09 +0000 (21:22 +0100)]
Release 5.66
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Thu, 10 Nov 2022 20:04:52 +0000 (21:04 +0100)]
build: Update library version
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Mon, 7 Nov 2022 22:01:10 +0000 (23:01 +0100)]
monitor: Add some definitions from Bluetooth 5.3 Core specification
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 4 Nov 2022 21:31:40 +0000 (14:31 -0700)]
monitor/att: Add support for decoding Characteristic Declaration
This adds supports for decoding the so called Characteristic
Declaration (0x2803):
> ACL Data RX: Handle 3585 flags 0x02 dlen 76
ATT: Read By Type Response (0x09) len 71
Attribute data length: 7
Attribute data list: 10 entries
Handle: 0x0002
Value:
200300052a
Properties: 0x20
Indicate (0x20)
Value Handle: 0x0003
Value UUID: Service Changed (0x2a05)
Handle: 0x0015
Value:
021600002a
Properties: 0x02
Read (0x02)
Value Handle: 0x0016
Value UUID: Device Name (0x2a00)
Handle: 0x0017
Value:
021800012a
Properties: 0x02
Read (0x02)
Value Handle: 0x0018
Value UUID: Appearance (0x2a01)
Handle: 0x0019
Value:
021a00a62a
Properties: 0x02
Read (0x02)
Value Handle: 0x001a
Value UUID: Central Address Resolution (0x2aa6)
Handle: 0x0029
Value:
102a00372a
Properties: 0x10
Notify (0x10)
Value Handle: 0x002a
Value UUID: Heart Rate Measurement (0x2a37)
Handle: 0x002c
Value:
022d00382a
Properties: 0x02
Read (0x02)
Value Handle: 0x002d
Value UUID: Body Sensor Location (0x2a38)
Handle: 0x002e
Value:
082f00392a
Properties: 0x08
Write (0x08)
Value Handle: 0x002f
Value UUID: Heart Rate Control Point (0x2a39)
Handle: 0x0031
Value:
0a32008a2a
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x0032
Value UUID: First Name (0x2a8a)
Handle: 0x0033
Value:
0a3400902a
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x0034
Value UUID: Last Name (0x2a90)
Handle: 0x0035
Value:
0a36008c2a
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x0036
Value UUID: Gender (0x2a8c)
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 4 Nov 2022 00:14:37 +0000 (17:14 -0700)]
monitor/att: Add handler support for Read by Type
This adds handler support for Read by Type so it can further decode
the values when the procedure is used.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marek Vasut [Tue, 1 Nov 2022 20:26:36 +0000 (21:26 +0100)]
tools: Switch hciattach_qualcomm to FAILIF macro completely
Use the FAILIF() macro consistently to avoid unused variable n warnings.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marek Vasut [Tue, 1 Nov 2022 11:53:33 +0000 (12:53 +0100)]
tools: Make hciattach_* firmware path build-time configurable
Make hciattach_qualcomm.c and hciattach_tialt.c behave the same way
as hciattach_bcm43xx.c does, where FIRMWARE_DIR can be overridden
at build time by using -DFIRMWARE_DIR= CFLAGS.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 28 Oct 2022 23:43:28 +0000 (16:43 -0700)]
tools/test-runner: Remove bluetooth.enable_ecred
L2CAP ECRED is now enabled by default by the following kernel change:
98f18bb78b7d ("Bluetooth: Add CONFIG_BT_LE_L2CAP_ECRED")
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Tue, 25 Oct 2022 22:16:45 +0000 (15:16 -0700)]
doc/ci.config: Add configuration for CI test
This patch adds the bluetooth kernel config file used by CI test, which
enables all bluetooth features.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Yao Xiao [Sat, 22 Oct 2022 03:13:33 +0000 (11:13 +0800)]
monitor: Ellisys: Add iso packet support
Ellisys Bluetooth Analyzer Injection API Services.pdf
HCI Packet Type Object
Value HCI Packet Type
0x05 HCI ISO Data (host to controller)
0x85 HCI ISO Data (controller to host)
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 20 Oct 2022 22:55:55 +0000 (15:55 -0700)]
client: Fix advertise.data command
advertise.data when no parameter is given shall print what is set on
ad.data not the ad.manufacturer which is a different field set by
advertise.manufacturer.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Frédéric Danis [Wed, 19 Oct 2022 20:30:28 +0000 (22:30 +0200)]
shared/util: Increase debug trace buffer size
Most of the debug traces are longer than 78 characters, increase the buffer
to not lost trace's end
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 18 Oct 2022 23:43:09 +0000 (16:43 -0700)]
monitor/att: Revert treating Notification/Indication as a request
Notification/Indication shall be treated as response (rsp=true) so the
correct database is used:
> ACL Data RX: Handle 3585 flags 0x02 dlen 14
ATT: Handle Value Notification (0x1b) len 9
Handle: 0x002a Type: Report (0x2a4d)
Data:
0000feffff0000
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 18 Oct 2022 21:25:10 +0000 (14:25 -0700)]
monitor/att: Detect cache changes
This attempts to detect if the were any changes on cache files since
they were last loaded and then attempt to reload them.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 18 Oct 2022 21:23:50 +0000 (14:23 -0700)]
settings: Fix scan-build warning
This fixes the following warning:
src/settings.c:281:7: warning: Branch condition evaluates to a garbage
value [core.uninitialized.Branch]
if (ret) {
^~~
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Abhay Maheta [Tue, 18 Oct 2022 04:38:31 +0000 (10:08 +0530)]
monitor/att: Add decoding support for GMCS
This adds decoding support for GMCS attributes.
< ACL Data TX: Handle 3585 flags 0x00 dlen 7
ATT: Read Request (0x0a) len 2
Handle: 0x0056 Type: Media Control Point Opcodes Supported (0x2ba5)
> ACL Data RX: Handle 3585 flags 0x02 dlen 9
ATT: Read Response (0x0b) len 4
Value:
33180000
Handle: 0x0056 Type: Media Control Point Opcodes Supported (0x2ba5)
Supported Opcodes: 0x00001833
Play (0x00000001)
Pause (0x00000002)
Stop (0x00000010)
Move Relative (0x00000020)
Previous Track (0x00000800)
Next Track (0x00001000)
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Abhay Maheta [Tue, 18 Oct 2022 04:38:29 +0000 (10:08 +0530)]
shared/mcp: Add initial code for handling MCP
This adds initial code for Media Control Profile for Client Role.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Abhay Maheta [Tue, 18 Oct 2022 04:38:28 +0000 (10:08 +0530)]
lib/uuid: Add GMCS UUIDs
This adds GMCS UUIDs which will be used by Media Control Profile.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Fri, 14 Oct 2022 18:57:20 +0000 (11:57 -0700)]
monitor: Fix incorrect vendor name for vendor cmd and evt
This patch fixes the issue that the vendor name for all vendor HCI
command and event are display as Microsoft.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Tue, 11 Oct 2022 14:06:12 +0000 (16:06 +0200)]
mesh: Keep cancelled SAR data for at least 10 sec
When a SAR transmission has been completed or cancelled, the recipent
should store the block authentication values for at least 10 seconds
and ignore new segments with the same values during this period. See
MshPRFv1.0.1 section 3.5.3.4.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Sat, 8 Oct 2022 01:14:10 +0000 (18:14 -0700)]
mgmt-tester: Fix Set Static Address tests
Set Static Address tests needs to power after setting the address since
the programming of the address using the HCI command only happens during
power on procedure.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Sat, 8 Oct 2022 01:14:09 +0000 (18:14 -0700)]
vhci: Add function to interact with force_static_address
This adds functions that can be used to set debugfs
force_static_address.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Sat, 8 Oct 2022 01:14:08 +0000 (18:14 -0700)]
btdev: Add support for setting bdaddr
This adds btdev_set_bdaddr so it is possible to set an arbritrary
address.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Abhay Maheta [Fri, 7 Oct 2022 17:45:17 +0000 (23:15 +0530)]
shared/bap: Fixing memory overwrite during ASE Enable Operation
This fixes memory overwrite during ASE Enable operation handling.
It avoids crashing of bluetoothd if metadata of more than sizeo of
size_t is received.
This also fixes storing metadata to stream structure.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 6 Oct 2022 14:59:27 +0000 (16:59 +0200)]
mesh: Fix msg cache ring buffer
The message cache should be a strict ring buffer, suppressed message
should not move to the front of the queue.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Thu, 6 Oct 2022 22:51:35 +0000 (15:51 -0700)]
tools: mgmt-tester - Test for HCI cmd after static addr set
This change checks for the expected HCI command after Static Address
change requested.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 6 Oct 2022 14:59:25 +0000 (16:59 +0200)]
mesh: provisionee: Check prov start parameters
Verify that all parameters in a Provisioning Start PDU are valid, also
compared to the capabilities that has been sent.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 6 Oct 2022 14:59:24 +0000 (16:59 +0200)]
mesh: provisionee: Handle failed provisioning
When a provisioning fails, all additionally received PDU should be
unexpected until link is closed by provisioner. See MshPRFv1.0.1 section
5.4.4.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 6 Oct 2022 14:59:23 +0000 (16:59 +0200)]
mesh: provisionee: Handle unknown PDUs
If an unknown PDU is received during provisioning, the provisioning
should fail with "Invalid PDU".
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 6 Oct 2022 14:59:22 +0000 (16:59 +0200)]
mesh: Update Key Refresh flag after provision
The Key Refresh flag in the Secure Network beacon is now correctly
updated based on provisioning data after being successfully provisioned.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Tue, 4 Oct 2022 08:25:30 +0000 (10:25 +0200)]
mesh: Always relay messages from Low Power nodes
If we receive a message from one of our Low Power nodes, which is
encrypted using frendship credentials and where the destination is not
us, we must relay that message using master credentials.
See MshPRFv1.0.1 section 3.6.6.2.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Tue, 4 Oct 2022 08:25:29 +0000 (10:25 +0200)]
mesh: Queue a friend update on IV Update change
A friend update should be queued when we receive a Secure Network beacon
that changes the IV Update state.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Tue, 4 Oct 2022 08:25:28 +0000 (10:25 +0200)]
mesh: Verify padding bits in Friend Poll messages
The padding bits in a Friend Poll message must be zero.
See MshPRFv1.0.1 section 3.6.5.1.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Tue, 4 Oct 2022 08:25:27 +0000 (10:25 +0200)]
mesh: Correct size of friend cache
The cache size communicated to the Low Power node should be the same as
the cache size actually used.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Inga Stotland [Wed, 5 Oct 2022 20:43:09 +0000 (13:43 -0700)]
mesh: Fix mesh to work with MESH_IO_TYPE_UNIT_TEST
This fixes mesh io flow for MESH_IO_TYPE_UNIT_TEST which
got broken after:
commit
9966cb8b6999a5f54fc13acbd7e1526512a84342
("mesh: Add new kernel MGMT based IO transport")
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Inga Stotland [Tue, 4 Oct 2022 00:14:59 +0000 (17:14 -0700)]
README: Update Mesh required Kernel Config section
Add CONFIG_CRYPTO_USER_API_SKCIPHER to the list of the required
.config options
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 29 Sep 2022 11:03:44 +0000 (13:03 +0200)]
mesh: Allow Key Refresh Phase 0 to 3 transition
Transition to Phase 3 from Phase 0 does not cause any state change, but
is a valid transition. See MshPRFv1.0.1 section 4.2.14.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 29 Sep 2022 11:03:43 +0000 (13:03 +0200)]
mesh: Allow Key refresh to skip Phase 2
If we are in Key Refresh Phase 1, and receive a Secure Network beacon
using the new NetKey and with KR flag set to 0, Phase 2 should be
skipped. See MshPRFv1.0.1 section 3.10.4.1.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 29 Sep 2022 11:03:42 +0000 (13:03 +0200)]
mesh: Ignore SNB with invalid IV Index values
If we are in IV update in progress state, and receive a Secure Network
beacon with an IV index equal to last known IV index + 1, and IV update
flag set to 1, it should be ignored. See MshPRFv1.0.1 section 3.10.5.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Thu, 29 Sep 2022 11:03:41 +0000 (13:03 +0200)]
mesh: Ignore Secure Network Beacon from subnet
If this node is a member of a primary subnet and receives a Secure Network
beacon on a secondary subnet with an IV Index greater than the last known
IV Index of the primary subnet, the Secure Network beacon shall be ignored.
See MshPRFv1.0.1 section 3.10.5.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Wed, 28 Sep 2022 20:54:47 +0000 (13:54 -0700)]
client/player: Fix attempting to acquire already acquired transport
If the transport has links check if the link is acquiring before
attempting to call Acquire otherwise it may cause an error to be
printed.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 27 Sep 2022 22:52:27 +0000 (15:52 -0700)]
tools: Fix mesh-tester to expect end of ADV
Tester was failing by not clearing the HCI queue of expected events
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 27 Sep 2022 19:24:19 +0000 (12:24 -0700)]
monitor/packet: Fix scan-build warnings
This fixes the following warnings:
monitor/packet.c:410:4: warning: Value stored to 'ts_pos' is never read
[deadcode.DeadStores]
ts_pos += n;
^ ~
monitor/packet.c:455:4: warning: Value stored to 'pos' is never read
[deadcode.DeadStores]
pos += n;
^ ~
monitor/packet.c:7477:2: warning: Value stored to 'mask' is never read
[deadcode.DeadStores]
mask = tx_phys;
^ ~~~~~~~
monitor/packet.c:7485:2: warning: Value stored to 'mask' is never read
[deadcode.DeadStores]
mask = rx_phys;
^ ~~~~~~~
monitor/packet.c:11229:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoA Constant Tone Extension";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11232:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoA Constant Tone Extension with 1us slots";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11235:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoD Constant Tone Extension with 2us slots";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11238:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "No Constant Tone Extension";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11241:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "Reserved";
^ ~~~~~~~~~~
monitor/packet.c:11242:3: warning: Value stored to 'color_on' is never read
[deadcode.DeadStores]
color_on = COLOR_RED;
^ ~~~~~~~~~
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Mon, 26 Sep 2022 23:01:54 +0000 (16:01 -0700)]
monitor/analyze: Fix scan-build warnings
This fixes the following warnings:
monitor/analyze.c:381:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:382:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:398:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:399:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:418:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:419:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:527:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(subtype);
^ ~~~~~~~~~~~~~~~
monitor/analyze.c:528:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(subtype);
^ ~~~~~~~~~~~~~~~
monitor/analyze.c:629:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:630:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:646:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:647:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:710:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:711:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Mon, 26 Sep 2022 22:53:41 +0000 (15:53 -0700)]
rctest: Fix scan-build warning
This fixes the following warning:
tools/rctest.c:131:2: warning: 1st function call argument is an
uninitialized value [core.CallAndMessage]
sdp_list_free(protos, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Mon, 26 Sep 2022 13:01:10 +0000 (15:01 +0200)]
mesh: Clear HB sub status field if disabled
When replying to a HB subscription get message, and the current state of
source or destination fields is zero (which means that HB subscription
is disabled), all fields in the status reply should be zero.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Mon, 26 Sep 2022 13:01:09 +0000 (15:01 +0200)]
mesh: Correct HB sub state updates
If heartbeat subscription is disabled, all fields should be set to zero
but collected data should be preserved. If HB subscription is enabled,
the collected data should be reset (which includes Min Hops = 0x7f).
HB subscription is disabled by setting any of the following fields to
zero: Source, destination or period log.
HB subscription is enabled by setting all the same fields to valid values.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Mon, 26 Sep 2022 13:01:08 +0000 (15:01 +0200)]
mesh: Reply to HB pub set with same fields
If a Config Heartbeat Publication Set message is unsuccessfully
processed, the fields in the status reply should be the same as in the
original message. See MshPRFv1.0.1 section 4.4.1.2.15.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Mon, 26 Sep 2022 13:01:07 +0000 (15:01 +0200)]
mesh: Correct u32 to u8 log transformation
Fixed the log transformation to correctly follow the value mapping
defined in the mesh profile (section 4.1.2).
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Thu, 22 Sep 2022 22:31:02 +0000 (15:31 -0700)]
mesh: Add new kernel MGMT based IO transport
1. Re-structures MGMT handling such that it is used to detect kernel
support of the mesh MGMT opcodes and events before selecting between
using MGMT or the legacy raw HCI socket method.
2. Re-structures main() to allow command line to prefer MGMT over HCI or
visa versa, plus optionally pass an explicte controller.
3. Adds mesh-io-mgmt as a transport.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Thu, 22 Sep 2022 22:31:01 +0000 (15:31 -0700)]
mesh: Improve PB-ADV timing for reliability
Because provisioning is not speed dependent, Timing on outbound PB-ADV
packets have been modified to be less likely missed by remote controlers
with looser timing capabilities.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Haochen Tong [Sun, 25 Sep 2022 16:31:39 +0000 (00:31 +0800)]
tools/mpris-proxy: unregister object path if player registration fails
The `owner' string, passed as user data, is freed if the player fails
registration, but the object path still exists. Upon program exiting,
the lingering path will be enumerated and the attached user data will be
freed again.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 10:51:41 +0000 (12:51 +0200)]
tools: fix printf format strings
time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 10:51:40 +0000 (12:51 +0200)]
monitor: fix printf format strings
time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 10:51:39 +0000 (12:51 +0200)]
client/player: fix printf format string
Use macros from inttypes.h for correct printf format specifier for
int64_t
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 23 Sep 2022 20:47:10 +0000 (13:47 -0700)]
client/gatt: Fix scan-build warning
This fixes the following warning:
client/gatt.c:2146:2: warning: Null pointer passed to 2nd parameter
expecting 'nonnull' [core.NonNullParamChecker]
memcpy(*dst_value + offset, src_val, src_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:58:14 +0000 (16:58 +0200)]
battery: provided_battery_property_changed_cb: check iterator
The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--src/battery.c::provided_battery_property_changed_cb(, , iter, );
+--dbus_message_iter_get_arg_type(iter);
...
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:58:13 +0000 (16:58 +0200)]
gatt: proxy_property_changed: check for NULL iterator
The passed iterator can be NULL as in
src/gatt-database.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--client/gatt.c::property_changed_cb(..., ..., iter, ...);
+--dbus_message_iter_get_arg_type(iter);
...
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:58:12 +0000 (16:58 +0200)]
client/gatt: proxy_property_changed: check for NULL iterator
The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--client/gatt.c::proxy_property_changed(..., ..., iter, ...);
+--dbus_message_iter_get_arg_type(iter);
...
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:58:11 +0000 (16:58 +0200)]
advertising: parse_tx_power: reset value if iter is NULL
Set property to its default value (as done in all other methods listed
in parsers[]).
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:57:31 +0000 (16:57 +0200)]
advertising: parse_[min|max]_interval: reset value if iter is NULL
Set property to its default value (as done in all other methods listed
in parsers[]).
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:55:57 +0000 (16:55 +0200)]
advertising: parse_min_interval: reset min_interval if iter is NULL
Set property to its default value (as done in all other methods listed
in parsers[]).
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:55:56 +0000 (16:55 +0200)]
advertising: parse_secondary: check for NULL iterator
The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--src/advertising.c::properties_changed(..., ..., iter, ...);
+--parse_secondary(iter, ...);
...
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:55:55 +0000 (16:55 +0200)]
advertising: parse_secondary: fix mask value
It looks like a wrong mask value is used here as only the bits mentioned
in adv_secondary::flag can be set again within the loop.
Replace magic number by preprocessor macro.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Christian Eggers [Fri, 23 Sep 2022 14:55:54 +0000 (16:55 +0200)]
advertising: parse_secondary: fix loop condition
"secondary" isn't an array of pointers, so the iterator can never be
NULL.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Fri, 23 Sep 2022 11:31:49 +0000 (13:31 +0200)]
mesh: Reply error if appkey added for wrong netkey
If a known appkey is added for a different netkey, the status reply
should be Invalid NetKey.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Isak Westin [Fri, 23 Sep 2022 11:31:48 +0000 (13:31 +0200)]
mesh: Clear addr field if virt sub failed
If processing failed for a Config Model Subscription Virtual Address
Add/Delete/Overwrite message, the address field in the status reply
should be set to zero. See MshPRFv1.0.1 section 4.4.1.2.8.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Thu, 22 Sep 2022 20:38:50 +0000 (13:38 -0700)]
lib: Add defines of new MGMT opcodes and events
Populated new opcodes and events into static mgmt_ev and mgmt_op string
arrays.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>