Tedd Ho-Jeong An [Tue, 4 May 2021 05:02:06 +0000 (22:02 -0700)]
src: Convert manpage to rst format
This patch converts the existing manpage for bluetoothd into
reStructuredText format.
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Tue, 4 May 2021 05:02:05 +0000 (22:02 -0700)]
monitor: Convert manpage to rst format
This patch adds support to convert reStructuredText formatted btmon
manpage to manpage with rst2man tool.
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Tue, 4 May 2021 05:02:04 +0000 (22:02 -0700)]
build: Fix manpage enable flag
This patch fixes the manpages installation with --enable-manpages option
so the manpages are not installed by default if the option is not set
during the configuration.
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Thu, 29 Apr 2021 08:14:28 +0000 (10:14 +0200)]
build: Create directory for ell/useful.h
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Tue, 27 Apr 2021 17:12:37 +0000 (19:12 +0200)]
mesh: Fix net_key_confirm parameter declaration
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Tue, 27 Apr 2021 17:08:15 +0000 (19:08 +0200)]
mesh: Fix network_id parameter declaration
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Fri, 23 Apr 2021 23:53:52 +0000 (16:53 -0700)]
tools/mgmt-tester: Fix to support emulator spec 5.2
This patch updates the check for supported spec by the BT emulator to
support HCI spec 5.2
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Fri, 23 Apr 2021 23:53:51 +0000 (16:53 -0700)]
tools/tester-runner: enable enhanced credit flow control mode
This patch enables enhanced credit flow control mode for l2cap.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Fri, 23 Apr 2021 23:53:50 +0000 (16:53 -0700)]
emulator/btdev: Add missing commands
This patch adds missing commands HCI_Read_RSSI and
HCI_Read_Transmit_Power_Level commands.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Inga Stotland [Thu, 15 Apr 2021 05:03:47 +0000 (22:03 -0700)]
shared/timeout-ell: Fix timeout_add() implementation
Since timeout_add() expects the timeout in milliseconds, the correct
ELL primitive to call is l_timeout_create_ms()
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Miao-chen Chou [Mon, 19 Apr 2021 23:36:02 +0000 (16:36 -0700)]
device: Reply to connect request if SDP search failed
SDP request can be initiated during BR/EDR connection. This fixes a
missing reply to the method call to prevent generic error message for
no reply.
The following test steps were performed:
(1) Put Bose QC35 into pairing mode, start scanning on bluetoothctl
(2) Turn off the headphones and connect to the headphones
(3) Verify that error should returns immediately to bluetoothctl
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Mon, 19 Apr 2021 18:21:49 +0000 (11:21 -0700)]
monitor: Add Intel read supported features command
< HCI Command: Intel Read Supported Features (0x3f|0x00a6) plen 1
Page: 0x01
> HCI Event: Command Complete (0x0e) plen 22
Intel Read Supported Features (0x3f|0x00a6) ncmd 1
Status: Success (0x00)
Page: 0x01
Max Pages: 0x02
Supported Features:
1f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Curtis Maves [Mon, 12 Apr 2021 20:34:26 +0000 (16:34 -0400)]
gatt: Either notify or indicate, do not do both
AcquireNotify and StartNotify starts notifications and/or indications
by whether the characteristic supports them. Before this patch, if both
were supported, Bluez would try to start both simultaneously. This
patch changes this behavior so if both are supported, only
notifications are started. Test cases have also be updated accordingly.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Sat, 10 Apr 2021 06:46:05 +0000 (23:46 -0700)]
tools/mgmt-tester: Add param check callback for LE Set Adv Params
The interval_min and interval_max in LE Set Advertising Parameters
command are changed/updated often whenever the values are tuned in the
kernel, and it causes some tests failure.
This patch adds a parameter check callback for LE Set Advertising
Parameters command to ignore the interval_min and interval_max
parameters.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Sat, 10 Apr 2021 06:46:04 +0000 (23:46 -0700)]
tools/mgmt-tester: Add callback routine for validating the parameter
This patch adds a callback routine for validating the received HCI
parameter, so it can customize to compare the parameters instead of
memcmp the full length.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Fri, 19 Mar 2021 20:38:24 +0000 (13:38 -0700)]
mesh: Add unit test IO
This adds a new type of mesh IO that is used for non-interactive testing.
The new io option can be specified on command line as:
--io unit:<socket_name>
When the bluetooth-meshd daemon starts with the "unit" IO type,
the daemon opens a socket (fd to open is provided after "unit:"
in <socket_name>). The communication with the daemon is done either
through the loop-back using mesh DBus-based APIs or the specified
named socket.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Thu, 8 Apr 2021 19:01:34 +0000 (12:01 -0700)]
mesh: Add Provisioning Confirmation validity check
Validate generated and received confirmation data is unique during
provisioning.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Dmitry Torokhov [Wed, 7 Apr 2021 22:33:47 +0000 (15:33 -0700)]
input/hog-lib: do not silently ignore missing connection in read_char()
Currently we silently ignore missing connection (attrib) in read_char(),
but not in the other GATT interfaces (such as write_char, discover_desc,
etc). The code should avoid calling read_char() when there is no active
connection instead, and logging errors will help us trace the offenders.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Dmitry Torokhov [Wed, 7 Apr 2021 22:34:18 +0000 (15:34 -0700)]
input/hog-lib: avoid scanning characteristics too early
We need to have active connection to fully discover a HOG instance,
and in the chain
bt_hog_new()->
gatt_db_foreach_service()->
foreach_hog_service()->
hog_attach_instance()
we have not set up hog->attrib yet. So let's skip calling
foreach_hog_chrc() from hog_attach_instance(), especially since
we will be calling bt_hog_attach() pretty much immediately after
bt_hog_new(), and we will be discovering characteristics there anyway.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Dmitry Torokhov [Wed, 7 Apr 2021 22:35:09 +0000 (15:35 -0700)]
input/hog-lib: add error handling when calling into gatt
When calling gatt_write_char(), gatt_read_char(), etc, id == 0 indicates
error. Let's recognize this fact and log it instead of queueing request
that will never be completed.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Wed, 7 Apr 2021 18:00:37 +0000 (11:00 -0700)]
btdev: Fix invalid BIG Complete event
Fields were not being initialized properly and no connection was
created so other commands using the same handle wouldn't work.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Keyur Parekh [Tue, 16 Mar 2021 14:41:36 +0000 (07:41 -0700)]
emulator: Add Create BIG command in emulator
This adds support for Create BIG command HCI
command in emulator. These changes are needed for
making the emulator useful for testing
LE Audio broadcast feature.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Tue, 6 Apr 2021 15:39:18 +0000 (17:39 +0200)]
tools: Print list of controller capabilities
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Sat, 3 Apr 2021 12:53:37 +0000 (14:53 +0200)]
Release 5.58
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Yu Liu [Fri, 2 Apr 2021 18:00:14 +0000 (11:00 -0700)]
doc/mgmt-api - Return connection direction in Device Connected Event
When an MGMT_EV_DEVICE_CONNECTED event is reported back to the user
space we will set the flags to tell if the established connection is
outbound or not. This is useful for the user space to log better metrics
and error messages.
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 2 Apr 2021 17:50:53 +0000 (10:50 -0700)]
obex: Fix warnings cause by using of deprecated APIs
obexd/src/main.c: In function 'main':
obexd/src/main.c:237:13: warning: Deprecated pre-processor symbol
237 | if (g_thread_supported() == FALSE)
| ^~~~~~~~~~~~~~~~~~~~~~~
obexd/src/main.c:238:3: warning: 'g_thread_init' is deprecated
[-Wdeprecated-declarations]
238 | g_thread_init(NULL);
| ^~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:111,
from obexd/src/main.c:31:
/usr/include/glib-2.0/glib/deprecated/gthread.h:261:10: note: declared here
261 | void g_thread_init (gpointer vtable);
| ^~~~~~~~~~~~~
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 2 Apr 2021 08:55:30 +0000 (10:55 +0200)]
Release 5.57
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 2 Apr 2021 08:41:13 +0000 (10:41 +0200)]
build: Update library version
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 2 Apr 2021 05:42:09 +0000 (07:42 +0200)]
monitor: Update RSSI printing function
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 2 Apr 2021 05:26:29 +0000 (07:26 +0200)]
build: Always link in the ell/useful.h header file
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Mon, 22 Mar 2021 20:10:10 +0000 (13:10 -0700)]
hog-lib: Fix crash when receiving UHID_GET_REPORT
If UHID_GET_REPORT is received but a report cannot be found, etc, the
would pass bt_hog as user_data instead of report to get_report_cb
leading to a crash.
Fixes https://github.com/bluez/bluez/issues/112
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Sonny Sasaka [Tue, 30 Mar 2021 18:38:35 +0000 (11:38 -0700)]
profiles/battery: Reset battery value cache on disconnect
Due to cache in batt object, bluetoothd fails to update publish the
battery value after reconnection when the battery value does not change
compared to before reconnection. We should reset the battery percentage
cache on disconnect.
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Manish Mandlik [Tue, 30 Mar 2021 06:15:49 +0000 (23:15 -0700)]
test: Fix AdvMonitor RSSI filter properties
Update the creation of Advertisement Monitor object as per the
decoupled RSSIThresholdsAndTimers strucure.
More info: doc/advertisement-monitor-api.txt
Reviewed-by: apusaka@chromium.org
Reviewed-by: howardchung@chromium.org
Reviewed-by: mcchou@chromium.org
Signed-off-by: Manish Mandlik <mmandlik@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Archie Pusaka [Tue, 30 Mar 2021 04:12:33 +0000 (12:12 +0800)]
adv_monitor: merge monitors with the same pattern
Some bluetooth chipset (e.g. Intel) doesn't support MSFT extension
monitors with the same pattern. In order to make them work, and also
to generally make their task easier, we merge monitors with the same
pattern in the userspace. Therefore, each monitor sent to the kernel
will all have different patterns.
If the merged monitor have different RSSI parameter, we would choose
the most lenient parameter of the two, since we can still do
additional filtering in the userspace. This way, we wouldn't miss any
information and can still get the benefit of offloading the filtering.
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Archie Pusaka [Tue, 30 Mar 2021 04:12:32 +0000 (12:12 +0800)]
adv_monitor: split rssi_parameters into its own struct
This is an intermediary step for the following merge pattern patch.
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 23 Mar 2021 23:25:33 +0000 (16:25 -0700)]
btdev: Set CIG ID and CIS ID when generating CIS requested
This is required in order for the host to properly accept/reject the
connection.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 23 Mar 2021 23:23:39 +0000 (16:23 -0700)]
btdev: Always set connection handle on CIS established
This is required in order for the host to be able to distinguished
errors if there are multiple CIS connections outstanding.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Wed, 24 Mar 2021 19:34:12 +0000 (12:34 -0700)]
mesh: Fix segmented msg RX with friendship
This fixes an uninitialized memory issue where a message received for
a local node is silently discarded if an uninitialized boolean is
mistakenly set to TRUE, when friendships exist.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Daniel Winkler [Tue, 16 Mar 2021 22:49:57 +0000 (15:49 -0700)]
doc/mgmt-api: Update documentation for scan_rsp param flag
This patch adds the new scannable flag to the Add Extended Advertising
Parameters MGMT API documentation.
Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Daniel Winkler [Tue, 16 Mar 2021 22:49:56 +0000 (15:49 -0700)]
advertising: Create and use scannable adv param flag
In order for the advertising parameters hci request to indicate that an
advertising set uses a scannable PDU, we pass a scannable flag along
with the initial parameters MGMT request. This flag is populated based
on the existence of any scan response data requested by the client.
Without this patch, a broadcast advertisement with a scan response will
either be rejected by the controller, or will ignore the requested scan
response. The patch is tested by performing the above and confirming
that the scan response is retrievable from a peer as expected.
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 19 Mar 2021 19:29:51 +0000 (20:29 +0100)]
monitor: Add basic decoding for MSFT extension
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 19 Mar 2021 17:43:02 +0000 (18:43 +0100)]
monitor: Add skeleton for Microsoft HCI extension
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Fri, 19 Mar 2021 16:59:47 +0000 (17:59 +0100)]
tools: Add command for enabling/disabling LL privacy feature
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Tedd Ho-Jeong An [Thu, 18 Mar 2021 20:46:40 +0000 (13:46 -0700)]
tools/mgmt-tester: Fix for scan response in read adv feature command
This patch fixes the test failure with the read advertising feature
API which is changed to include the scan response flag.
Read Advertising Features - Success 1 (No instance) Failed
Read Advertising Features - Success 2 (One instance) Failed
Read Ext Advertising Features - Success 3 (PHY flags) Failed
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Sonny Sasaka [Tue, 16 Mar 2021 22:16:48 +0000 (15:16 -0700)]
monitor: Add option to force output color
Sometimes we want to force output color even when stdout is not a
terminal, for example when piping the output to a filter script and then
piping it further to a pager which can display colors.
This patch provides a general option to force whether color is on or off
(always and never), or leave btmon to decide (auto).
Reviewed-by: Daniel Winkler <danielwinkler@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Daniel Winkler [Tue, 16 Mar 2021 23:22:17 +0000 (16:22 -0700)]
doc/advertising-api: Add adv SupportedFeatures to doc
Add supported features to advertising dbus api.
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Daniel Winkler [Tue, 16 Mar 2021 23:22:16 +0000 (16:22 -0700)]
client: Add adv SupportedFeatures to bluetoothctl
This change adds SupportedFeatures to be shown in "show" option of
bluetoothctl. It was tested with and without kernel support for features
to verify that they are shown or not shown correctly.
Change was tested by verifying SupportedFeatures were populated
correctly in bluetoothctl on hatch and kukui chromebooks
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Daniel Winkler [Tue, 16 Mar 2021 23:22:15 +0000 (16:22 -0700)]
advertising: Add SupportedFeatures to LEAdvertisingManager1
The new SupportedFeatures member tells advertising clients whether the
platform has hardware support for advertising or capability to set tx
power of advertisements.
Additionally, fix small typo in "secondary_exists" function name.
Change is tested on hatch and kukui chromebooks by using dbus-send to
verify that SupportedFeatures always exists, and is only populated when
extended advertising is available.
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 16 Mar 2021 20:56:49 +0000 (13:56 -0700)]
build: Fix build with latest ELL tree
Latest ELL tree has introduced useful.h and main-private.h which are
required to build:
ell/cert-crypto.c:35:10: fatal error: useful.h: No such file or
directory
35 | #include "useful.h"
| ^~~~~~~~~~
...
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Ayush Garg [Tue, 16 Mar 2021 10:57:38 +0000 (16:27 +0530)]
btmgmt: Fix printing Set PHY Configuration command error
Error was printed as MGMT_OP_GET_PHY_CONFIGURATION instead of
MGMT_OP_SET_PHY_CONFIGURATION.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Archie Pusaka [Tue, 16 Mar 2021 04:12:37 +0000 (12:12 +0800)]
shared/gatt-client: fix BT_ATT_OP_HANDLE_NFY_MULT parsing
We need to advance the pdu pointer after parsing each block of
notification data.
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Frédéric Danis [Tue, 16 Mar 2021 17:18:36 +0000 (18:18 +0100)]
profiles: Use timeout_add_seconds
Replace calls to g_timeout_add_seconds() by the timeout_add_seconds()
wrapper which takes care of 0 delay.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Frédéric Danis [Tue, 16 Mar 2021 17:18:35 +0000 (18:18 +0100)]
plugins: Use timeout_add_seconds
Replace calls to g_timeout_add_seconds() by the timeout_add_seconds()
wrapper which takes care of 0 delay.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Frédéric Danis [Tue, 16 Mar 2021 17:18:34 +0000 (18:18 +0100)]
core: Use timeout_add_seconds
Replace calls to g_timeout_add_seconds() by the timeout_add_seconds()
wrapper which takes care of 0 delay.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Frédéric Danis [Tue, 16 Mar 2021 17:18:33 +0000 (18:18 +0100)]
shared/timeout: Add timeout_add_seconds abstraction
g_timeout_add_seconds() call doesn't ensure the time for the first call of
the timer if the delay is less or equal to 1 second.
In case of a 0 delay call g_idle_add() instead of g_timeout_add_seconds().
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Keyur Parekh [Thu, 11 Mar 2021 18:35:50 +0000 (10:35 -0800)]
emulator: Periodic Advertising Command
This adds support for Periodic Advertising HCI
command in the emulator. These changes are the
first step in making the emulator useful for
testing the LE Audio Broadcast feature
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Kiran K [Sun, 7 Mar 2021 09:18:45 +0000 (14:48 +0530)]
monitor: Fix decoding Read Local Supported Codec Capabilities
Codec capabilities wern't properly decoded due to wrong offset
< HCI Command: Read Local Supported Codec Capabilities (0x04|0x000e) plen 7
Codec: A-law log (0x01)
Logical Transport Type: 0x01
Codec supported over BR/EDR ACL
Direction: Input (Host to Controller) (0x00)
> HCI Event: Command Complete (0x0e) plen 18
Read Local Supported Codec Capabilities (0x04|0x000e) ncmd 1
Status: Success (0x00)
Number of codec capabilities: 3
Capabilities #0:
aa bb cc dd ....
Capabilities #1:
11 22 33 44 55 ."3DU
Capabilities #2:
ff .
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 11 Mar 2021 15:36:07 +0000 (07:36 -0800)]
avdtp: Fix removing all remote SEPs when loading from cache
If avdtp_discover is called after cache has been loaded it end up
removing all remote SEPs as they have not been discovered yet.
Fixes: https://github.com/bluez/bluez/issues/102
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Mon, 8 Mar 2021 23:36:53 +0000 (15:36 -0800)]
mesh: Validate OTA provision security material
When validating incoming security material, ensure that the data is
unique to the provisioning session.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Mon, 8 Mar 2021 22:08:16 +0000 (14:08 -0800)]
monitor: Fix invalid access
ident can be NULL when printing user logs which may lead ot invalid
access.
Fixes: https://github.com/bluez/bluez/issues/92
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Sun, 7 Mar 2021 17:50:39 +0000 (18:50 +0100)]
monitor: Decode Broadcom LM Diag vendor events
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Sun, 7 Mar 2021 17:27:14 +0000 (18:27 +0100)]
monitor: Fix random address decoding for extending advertising
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Sun, 7 Mar 2021 13:39:45 +0000 (14:39 +0100)]
monitor: Add missing strings for management command codes
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 5 Mar 2021 22:23:44 +0000 (14:23 -0800)]
gatt: Fix registering DIS without a valid source
If source has not been set don't register DIS as it would not contain
any useful information and by doing this it actually allows systems to
register their own DIS instance.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 5 Mar 2021 22:56:47 +0000 (14:56 -0800)]
main.conf: Enable passing false to DeviceID
This adds support for setting DeviceID to false so plaforms can disable
DeviceID.
Fixes: https://github.com/bluez/bluez/issues/101
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 4 Mar 2021 22:20:31 +0000 (14:20 -0800)]
adapter: Return Busy error when setting is pending
This returns an error if application attempts to change a property that
is pending.
Fixes: https://github.com/bluez/bluez/issues/99
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 4 Mar 2021 22:17:40 +0000 (14:17 -0800)]
adapter: Fix not using the correct setting
set_mode shall use opcode to identify what setting are being changed
rather then the mode.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Howard Chung [Tue, 2 Mar 2021 02:25:51 +0000 (10:25 +0800)]
core: fix a typo in dev_connect
Based on the context, it should be 'at least' instead of 'at list'.
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 2 Mar 2021 19:38:33 +0000 (11:38 -0800)]
shared/gatt-server: Fix not properly checking for secure flags
When passing the mask to check_permissions all valid permissions for
the operation must be set including BT_ATT_PERM_SECURE flags.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Sonny Sasaka [Tue, 2 Mar 2021 00:40:19 +0000 (16:40 -0800)]
monitor: Add option to set fallback width
Sometimes we want to be able to pipe the output of btmon to a
non-terminal device. The current fallback width is usually not long
enough so this patch adds an option to specify the column width. This is
especially needed for text logs from bluetoothd.
Reviewed-by: Daniel Winkler <danielwinkler@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 2 Mar 2021 23:09:13 +0000 (15:09 -0800)]
btdev: Add support for Configure Data Path
> HCI Event: Command Complete (0x0e) plen 68
Read Local Supported Commands (0x04|0x0002) ncmd 1
Status: Success (0x00)
Commands: 169 entries
...
Configure Data Path (Octet 45 - Bit 5)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 2 Mar 2021 22:49:57 +0000 (14:49 -0800)]
monitor: Add support for decoding Configure Data Path
< HCI Command: Configure Data Path (0x03|0x0083) plen 3
Direction: Input (Host to Controller) (0x00)
ID: 0
Vendor Specific Config Length: 0
Vendor Specific Config:
> HCI Event: Command Complete (0x0e) plen 4
Configure Data Path (0x03|0x0083) ncmd 1
Status: Success (0x00)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Sat, 27 Feb 2021 01:00:49 +0000 (17:00 -0800)]
btdev: Add support Read Local Supported Controller Delay
> HCI Event: Command Complete (0x0e) plen 68
Read Local Supported Commands (0x04|0x0002) ncmd 1
Status: Success (0x00)
Commands: 168 entries
...
Read Local Supported Controller Delay (Octet 45 - Bit 4)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Sat, 27 Feb 2021 00:55:44 +0000 (16:55 -0800)]
monitor: Add support for decoding Read Local Controller Delay
< HCI Command: Read Local Supported Controller Delay (0x04|0x000f) plen 8
Codec: mSBC (0x05)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Direction: Input (Host to Controller) (0x00)
Length Codec Configuration: 0
> HCI Event: Command Complete (0x0e) plen 10
Read Local Supported Controller Delay (0x04|0x000f) ncmd 1
Status: Success (0x00)
Minimum Controller delay: 0 us (0x000000)
Maximum Controller delay: 0 us (0x000000)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 26 Feb 2021 22:34:09 +0000 (14:34 -0800)]
btdev: Add support Read Local Supported Codec Capabilities
> HCI Event: Command Complete (0x0e) plen 68
Read Local Supported Commands (0x04|0x0002) ncmd 1
Status: Success (0x00)
Commands: 167 entries
...
Read Local Supported Codec Capabilities (Octet 45 - Bit 3)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 25 Feb 2021 23:20:28 +0000 (15:20 -0800)]
monitor: Add support for decoding Read Local Supported Codec Capabilities
< HCI Command: Read Local Supported Codec Capabilities (0x04|0x000e) plen 7
Codec ID: mSBC (0x05)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Direction: Input (Host to Controller) (0x00)
> HCI Event: Command Complete (0x0e) plen 5
Read Local Supported Codec Capabilities (0x04|0x000e) ncmd 1
Status: Success (0x00)
Number of codec capabilities: 0
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 25 Feb 2021 01:40:20 +0000 (17:40 -0800)]
btdev: Add support Read Local Supported Codecs V2
> HCI Event: Command Complete (0x0e) plen 68
Read Local Supported Commands (0x04|0x0002) ncmd 1
Status: Success (0x00)
Commands: 167 entries
...
Read Local Supported Codecs V2 (Octet 45 - Bit 2)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Thu, 25 Feb 2021 00:50:01 +0000 (16:50 -0800)]
monitor: Add support for decoding Read Local Supported Codecs V2
< HCI Command: Read Local Supported Codecs V2 (0x04|0x000d) plen 0
> HCI Event: Command Complete (0x0e) plen 18
Read Local Supported Codecs V2 (0x04|0x000d) ncmd 1
Status: Success (0x00)
Number of supported codecs: 6
Codec: u-law log (0x00)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Codec: A-law log (0x01)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Codec: CVSD (0x02)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Codec: Transparent (0x03)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Codec: Linear PCM (0x04)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Codec: mSBC (0x05)
Logical Transport Type: 0x02
Codec supported over BR/EDR SCO and eSCO
Number of vendor codecs: 0
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Mon, 1 Mar 2021 22:33:35 +0000 (14:33 -0800)]
monitor: Rename big_id fields to handle
This makes it aligned to the terminology used by the spec.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Mon, 1 Mar 2021 22:15:25 +0000 (14:15 -0800)]
monitor: Fix BIG Create Sync decoding
Number of Bis is actually at the end of the PDU, also avoid prefixing with
big when it is implied by the struct name.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Wed, 24 Feb 2021 23:26:15 +0000 (15:26 -0800)]
monitor: Rename big_id field to handle
This avoids prefixing with big when it is implied by the struct name.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Przemysław Fierek [Fri, 26 Feb 2021 13:27:40 +0000 (14:27 +0100)]
mesh: Fix infinite loop on IVIndex update
This patch fixes inifinite loop problem caused by recurring call
of the `net_key_beacon_refresh` function.
Problem occurs when at least two nodes are connected to the same
BlueZ instance and they are connected to the same network
(use same network key). Issue is triggered when IVIndex update
process stabilize and one of the nodes receives network beacon
with IVUpdate flag set to 0. Then it processes the "local" beacon
and compose new `snb` (with IVUpdate flag set to 0) attached to
`net_key` instance. After that it calls `net_local_beacon` and
another node processes the new beacon (this node has IVUpdate
flag still set to 1). Note that the `net->ivupdate` has set value 1.
The `update_iv_ivu_state` says that "IVU clear attempted too soon".
The node composes new `snb` with IVUpdate flag set to 1 and writes
it to the `net_key` instance in the `net_key_beacon_refresh`
function. After that it calls `net_local_beacon` which causes
repeat of all process. We are rotating in this loop until end-of-memory.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 23 Feb 2021 18:51:20 +0000 (10:51 -0800)]
tools: Cleanup deprecated symbolic file permissions
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 23 Feb 2021 18:46:15 +0000 (10:46 -0800)]
src: Cleanup deprecated symbolic file permissions
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 23 Feb 2021 18:45:02 +0000 (10:45 -0800)]
profiles: Cleanup deprecated symbolic file permissions
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 23 Feb 2021 18:43:42 +0000 (10:43 -0800)]
peripheral: Cleanup deprecated symbolic file permissions
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 23 Feb 2021 18:36:38 +0000 (10:36 -0800)]
obexd: Cleanup deprecated symbolic file permissions
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Brian Gix [Tue, 23 Feb 2021 18:39:57 +0000 (10:39 -0800)]
mesh: Cleanup deprecated symbolic file permissions
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 23 Feb 2021 19:07:16 +0000 (11:07 -0800)]
monitor: Fix handling of BT_HCI_EVT_LE_BIG_SYNC_ESTABILISHED
This adds the missing fields for BT_HCI_EVT_LE_BIG_SYNC_ESTABILISHED
event.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Tue, 23 Feb 2021 19:02:53 +0000 (11:02 -0800)]
monitor: Fix handling of BT_HCI_EVT_LE_BIG_COMPLETE
This adds the missing fields for BT_HCI_EVT_LE_BIG_COMPLETE event.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Mon, 22 Feb 2021 20:12:40 +0000 (21:12 +0100)]
Release 5.56
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Marcel Holtmann [Mon, 22 Feb 2021 20:00:05 +0000 (21:00 +0100)]
build: Update library version
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Archie Pusaka [Mon, 22 Feb 2021 06:07:43 +0000 (14:07 +0800)]
adapter: fix set_mode MGMT_OP_SET_BONDABLE
Currently pending_settings is assigned MGMT_SETTING_DISCOVERABLE,
but it should have been MGMT_SETTING_BONDABLE instead.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Archie Pusaka [Mon, 22 Feb 2021 05:18:45 +0000 (13:18 +0800)]
adapter: Check whether adapter is pending powered
The powered setting of adapter is frequently being checked, but the
check only accounts for whether it currently is powered. When powering
off the adapter, there is a brief moment when the adapter is already
off kernel-wise, but powered property is still true.
If powered property is accessed at this time, some problems might
occur. For example, if RemoveDevice DBus API is called, we would still
carry out the request and remove the device from the user space, but
we would fail to remove it from the kernel, therefore resulting an
error when we want to re-pair the device.
This patch addresses this issue by also checking whether adapter is
being powered off when checking for powered.
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Curtis [Fri, 19 Feb 2021 17:49:46 +0000 (12:49 -0500)]
gatt-database: Fix notifying on indicatable attr
When a local GATT characteristic has both the indicate and notify
properties, notifications will not be send to clients requesting them.
This change fixes this, allowing for notifications to be sent.
Also simplifies logic about when notifications/indications should
be sent.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Szymon Janc [Thu, 11 Feb 2021 15:39:13 +0000 (16:39 +0100)]
sixaxis: Fix Bluetooth PS3 clone joypad being named like the original
When cable pairing a PS3 clone device, we should try and keep the USB device
name to create a new btd_device so that the joypad is named after its USB name
when connecting through Bluetooth.
If that isn't done, "Shanwan" clone joypads are named like the genuine joypads, and
kernel Bluetooth quirks aren't applied.
gh-issue: https://github.com/bluez/bluez/issues/46
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 19 Feb 2021 23:19:25 +0000 (15:19 -0800)]
btdev: Fix not sending ISO packets
ISO packets were not correctly parsed causing them to not be sent
properly.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 19 Feb 2021 23:18:24 +0000 (15:18 -0800)]
emulator: Add option for enabling debug with btvirt
This adds -d/--debug options which enables debug of vhci instance on
btvirt.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Luiz Augusto von Dentz [Fri, 19 Feb 2021 23:17:02 +0000 (15:17 -0800)]
vhci: Add vhci_set_debug
This enables debug with btdev_set_debug.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Inga Stotland [Thu, 18 Feb 2021 00:39:56 +0000 (16:39 -0800)]
mesh: Combine common functions for NetKeys and AppKeys
No change in functionality, code tightening.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>