platform/upstream/bluez.git
2 years agoclient/gatt: Fix using atoi
Luiz Augusto von Dentz [Mon, 8 Nov 2021 19:15:44 +0000 (11:15 -0800)]
client/gatt: Fix using atoi

atoi doesn't support values entered in hexadecimal (0x...) which is
likely the prefered format for the likes of handles, etc, so this
replaces the uses of atoi with strtol.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomidi: Free ALSA seq resources in midi_device_remove()
Jacek Konieczny [Mon, 1 Nov 2021 13:49:18 +0000 (14:49 +0100)]
midi: Free ALSA seq resources in midi_device_remove()

Sometimes, on connection error, this gets called and frees the device
when midi_disconnect() was not called which would leave ALSA sequencer
objects leaking.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoadapter: Remove "Master" entry from LTK storage
Archie Pusaka [Wed, 3 Nov 2021 09:02:55 +0000 (17:02 +0800)]
adapter: Remove "Master" entry from LTK storage

The entry has been deprecated since 2014 and it's time to remove them
altogether.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc: Add PeripheralLongTermKey for storing LTK
Archie Pusaka [Wed, 3 Nov 2021 09:02:54 +0000 (17:02 +0800)]
doc: Add PeripheralLongTermKey for storing LTK

Update doc to reflect update in adapter.c.

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>
2 years agoadapter: Use PeripheralLongTermKey to store LTK
Archie Pusaka [Wed, 3 Nov 2021 09:02:53 +0000 (17:02 +0800)]
adapter: Use PeripheralLongTermKey to store LTK

Introducing PeripheralLongTermKey group for storing LTK info to
replace the less inclusive term. Currently we still need to write/read
from both to ensure smooth transition, but later we should deprecate
the old term.

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>
2 years agodevice: Fix not updating the auto-connect/accept list
Luiz Augusto von Dentz [Tue, 2 Nov 2021 00:08:15 +0000 (17:08 -0700)]
device: Fix not updating the auto-connect/accept list

When receiving a new IRK the device address is updated but the old
address is not removed from the auto-connect/accept list.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoadvertising-api: Clarify Duration property
Luiz Augusto von Dentz [Tue, 2 Nov 2021 04:35:52 +0000 (21:35 -0700)]
advertising-api: Clarify Duration property

Duration property refers to the rotation duration not the actual
lifetime of the advertising which is controlled by the Timeout
property.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomgmt-tester: Add test for Limited/Device Privacy
Luiz Augusto von Dentz [Mon, 1 Nov 2021 22:24:34 +0000 (15:24 -0700)]
mgmt-tester: Add test for Limited/Device Privacy

This adds a test for Limited/Device Privacy (0x02):

@ MGMT Command: Set Privacy (0x002f) plen 17
        Privacy: Limited (0x02)
        Key: 01020304050607080102030405060708
@ MGMT Event: Command Complete (0x0001) plen 7
      Set Privacy (0x002f) plen 4
        Status: Success (0x00)
        Current settings: 0x00002080
          BR/EDR
          Privacy
@ MGMT Event: New Settings (0x0006) plen 4
        Current settings: 0x00002080
          BR/EDR
          Privacy

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomain.conf: Fix Privacy modes
Luiz Augusto von Dentz [Mon, 1 Nov 2021 22:01:04 +0000 (15:01 -0700)]
main.conf: Fix Privacy modes

Device privacy 0x01 uses RPA regardless of the discoverable setting thus
it conforms to network mode not device mode.

Also this improves documentation to state what is the expectation of
each mode since it may not have been very clear by just using the terms
from the spec.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Add LL Privacy test cases
Tedd Ho-Jeong An [Fri, 29 Oct 2021 18:29:29 +0000 (11:29 -0700)]
tools/mgmt-tester: Add LL Privacy test cases

This patch adds LL Privacy related test cases.

Multi Ext Advertising - Success 3 (Add 2 Advs)
Multi Ext Advertising - Success 4 (Remove Adv)
Multi Ext Advertising - Success 5 (Remove all)
Multi Ext Advertising - Success 6 (Add w/o power on)
Multi Ext Advertising - Fail (Add MAX)

LL Privacy - Add Device 1 (Add to AL)
LL Privacy - Add Device 2 (Add to RL)
LL Privacy - Add Device 3 (Enable RL)
LL Privacy - Add Device 4 (2 Devices to AL)
LL Privacy - Add Device 5 (2 Devices to RL)
LL Privacy - Add Device 6 (RL is full)
LL Privacy - Add Device 7 (WL is full)
LL Privacy - Add Device 8 (Disable Adv)
LL Privacy - Add Device 9 (Multi Adv)
LL Privacy - Add Device 10 (Multi Dev and Multi Adv)

LL Privacy - Remove Device 1 (Remove from AL)
LL Privacy - Remove Device 2 (Remove from RL)
LL Privacy - Remove Device 3 (Disable RL)
LL Privacy - Remove Device 4 (Disable Adv)
LL Privacy - Remove Device 5 (Multi Adv)

LL Privacy - Start Discovery 1 (Disable RL)
LL Privacy - Start Discovery 2 (Disable RL)

LL Privacy - Advertising 1 (Scan Results)
LL Privacy - Acceptor 1
LL Privacy - Acceptor 2

LL Privacy - Pair 1
LL Privacy - Pair 2 (Add to AL)
LL Privacy - Unpair 1
LL Privacy - Unpair 2 (Remove from AL)

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Update the expected manufacturer of emulator
Tedd Ho-Jeong An [Fri, 29 Oct 2021 18:29:28 +0000 (11:29 -0700)]
tools/mgmt-tester: Update the expected manufacturer of emulator

This patch updates the expected manufacturer of the emulator for the
following test cases:

> Read Ext Controller Info 1                           Failed
> Read Ext Controller Info 2                           Failed
> Read Ext Controller Info 3                           Failed
> Read Ext Controller Info 4                           Failed
> Read Ext Controller Info 5                           Failed

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodevice: Fix not clearing error on update_bredr_services
Luiz Augusto von Dentz [Wed, 27 Oct 2021 19:53:34 +0000 (12:53 -0700)]
device: Fix not clearing error on update_bredr_services

When trying to loads contents from file using g_key_file_load_from_file
it may cause an error which needs to be cleared since the gerr is
reused, also make sure the file is always created upfront to avoid
having such error when storage has not been initialized.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoobexd: Add missing phonebook backends
Luiz Augusto von Dentz [Tue, 26 Oct 2021 18:03:01 +0000 (11:03 -0700)]
obexd: Add missing phonebook backends

This adds missing phonebook backends to EXTRA_DIST so they can be build
from tarballs.

Fixes: https://github.com/bluez/bluez/issues/222
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoMakefile: Fix code style
Luiz Augusto von Dentz [Tue, 26 Oct 2021 17:54:12 +0000 (10:54 -0700)]
Makefile: Fix code style

Fix lines going over 80 columns.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt: added missing disconn_id's and removed extra check
Bernie Conrad [Tue, 12 Oct 2021 21:51:51 +0000 (14:51 -0700)]
gatt: added missing disconn_id's and removed extra check

Adds missing assignment to disconn_id for pending operations and removes
check that is already handled by checking if the owner_queue of the op
is gone at the start of write_reply_cb.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Add support for experimental feature in setup
Tedd Ho-Jeong An [Mon, 25 Oct 2021 20:31:20 +0000 (13:31 -0700)]
tools/mgmt-tester: Add support for experimental feature in setup

This patch adds support for experimental feature in setup_settings
options.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoemulator: Add support to get the advertising address
Tedd Ho-Jeong An [Mon, 25 Oct 2021 20:31:19 +0000 (13:31 -0700)]
emulator: Add support to get the advertising address

This patch add supprt emulator to get the advertising address of the
central device.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoemulator: bthost: Add support LE Ext Adv Report
Tedd Ho-Jeong An [Mon, 25 Oct 2021 20:31:18 +0000 (13:31 -0700)]
emulator: bthost: Add support LE Ext Adv Report

This patch adds support LE_Extended_Advertising_Report Eevnt in bthost.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoemulator: Add support to config the accept and resolve list
Tedd Ho-Jeong An [Mon, 25 Oct 2021 20:31:17 +0000 (13:31 -0700)]
emulator: Add support to config the accept and resolve list

This patch adds interfaces to config the accept list and resolve list in
the btdev.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agobtdev: Fix using the callback return as command complete
Luiz Augusto von Dentz [Fri, 22 Oct 2021 21:51:49 +0000 (14:51 -0700)]
btdev: Fix using the callback return as command complete

Command callback can only be used when generating a command status as
command complete can carry more than just the status.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoadapter: Fix storing IRK causing invalid read
Luiz Augusto von Dentz [Fri, 22 Oct 2021 20:10:09 +0000 (13:10 -0700)]
adapter: Fix storing IRK causing invalid read

When storing an IRK the storage file may not have been created yet
since that uses the device address which is likely changed to the
identity address causing the following trace:

Invalid read of size 8
   at 0x196452: store_irk.constprop.0 (adapter.c:8679)
   by 0x198C92: new_irk_callback (adapter.c:8737)
   by 0x1CF6DC: queue_foreach (queue.c:207)
   by 0x1D1394: process_notify (mgmt.c:308)
   by 0x1D1394: can_read_data (mgmt.c:374)
   by 0x1E0634: watch_callback (io-glib.c:157)
   by 0x4954A9E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6600.8)
   by 0x49A6A97: ??? (in /usr/lib64/libglib-2.0.so.0.6600.8)
   by 0x4954162: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.6600.8)
   by 0x1E0CD4: mainloop_run (mainloop-glib.c:66)
   by 0x1E10B1: mainloop_run_with_signal (mainloop-notify.c:188)
   by 0x12E3FC: main (main.c:1210)
 Address 0x6534418 is 8 bytes inside a block of size 16 free'd

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agobtdev: Set Local RPA when own_addr_type is 0x03
Luiz Augusto von Dentz [Thu, 21 Oct 2021 21:35:21 +0000 (14:35 -0700)]
btdev: Set Local RPA when own_addr_type is 0x03

This enables the emulator to properly emulate the generation of a Local
RPA so it always set the random_addr when Create Connection sets 0x03 as
own_addr_type 0x03:

< HCI Command: LE Extended.. (0x08|0x0043) plen 26
        Filter policy: Accept list is not used (0x00)
        Own address type: Random (0x03)
        Peer address type: Public (0x00)
        Peer address: 00:AA:01:01:00:00 (Intel Corporation)
        Initiating PHYs: 0x01
        Entry 0: LE 1M
          Scan interval: 60.000 msec (0x0060)
          Scan window: 60.000 msec (0x0060)
          Min connection interval: 30.00 msec (0x0018)
          Max connection interval: 50.00 msec (0x0028)
          Connection latency: 0 (0x0000)
          Supervision timeout: 420 msec (0x002a)
          Min connection length: 0.000 msec (0x0000)
          Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4
      LE Extended Create Connection (0x08|0x0043) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 31
      LE Enhanced Connection Complete (0x0a)
        Status: Success (0x00)
        Handle: 42
        Role: Central (0x00)
        Peer address type: Public (0x00)
        Peer address: 00:AA:01:01:00:00 (Intel Corporation)
        Local resolvable private address: 60:0C:C5:B9:10:5D (Resolvable)
        Peer resolvable private address: 00:00:00:00:00:00 (Non-Resolvable)
        Connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Central clock accuracy: 0x00

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomgmt-tester: Fix expected manufacturer
Luiz Augusto von Dentz [Thu, 21 Oct 2021 21:34:04 +0000 (14:34 -0700)]
mgmt-tester: Fix expected manufacturer

The emulator is now using Linux Foundation manufacturer ID.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/hcitool: Fix the descriptions of leal* commands
Archie Pusaka [Fri, 24 Sep 2021 09:29:21 +0000 (17:29 +0800)]
tools/hcitool: Fix the descriptions of leal* commands

The descriptions of leal* commands are copied from lewl* commands.
However they should use "accept list" instead.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoemulator: Add initial support for MSFT vendor commands
Luiz Augusto von Dentz [Wed, 20 Oct 2021 18:41:46 +0000 (11:41 -0700)]
emulator: Add initial support for MSFT vendor commands

This adds the initial support for MSFT vendor commands and enable them
when in btvirt:

< HCI Command: Microsoft Ex.. (0x3f|0x001e) plen 1
      Read Supported Features (0x00)
> HCI Event: Command Complete (0x0e) plen 14
      Microsoft Extension (0x3f|0x001e) ncmd 1
      Read Supported Features (0x00)
        Status: Success (0x00)
        Features: 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          RSSI Monitoring feature for BR/EDR
          RSSI Monitoring feature for LE connections
          RSSI Monitoring of LE advertisements
          Advertising Monitoring of LE advertisements
          Verifying the validity of P-192 and P-256 keys
          Continuous Advertising Monitoring
        Event prefix length: 0
        Event prefix:
< HCI Command: Microsoft Ex.. (0x3f|0x001e) plen 2
      LE Set Advertisement Filter Enable (0x05)
        Enable: All filter conditions (0x01)
> HCI Event: Command Complete (0x0e) plen 5
      Microsoft Extension (0x3f|0x001e) ncmd 1
      LE Set Advertisement Filter Enable (0x05)
        Status: Success (0x00)

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomonitor: Enable decoding of MSFT extension with emulator
Luiz Augusto von Dentz [Wed, 20 Oct 2021 21:29:08 +0000 (14:29 -0700)]
monitor: Enable decoding of MSFT extension with emulator

This enables decoding MSFT extension with emulator instances since it
shall be the only one using Linux Foundation as manufacturer.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agobtdev: Use Linux Foundation as manufacturer
Luiz Augusto von Dentz [Wed, 20 Oct 2021 21:27:01 +0000 (14:27 -0700)]
btdev: Use Linux Foundation as manufacturer

This makes the emulator use Linux Foundation manufacturer id which
shall be simpler to distinguish emulator instances since it is unlikely
there will be other vendors using it.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoemulator/vhci: Fix writing msft_opcode using binary format
Luiz Augusto von Dentz [Wed, 20 Oct 2021 18:39:27 +0000 (11:39 -0700)]
emulator/vhci: Fix writing msft_opcode using binary format

debugfs expects values in string format not binary format.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomonitor/msft: Add feature bits definition
Luiz Augusto von Dentz [Tue, 19 Oct 2021 23:41:05 +0000 (16:41 -0700)]
monitor/msft: Add feature bits definition

This adds the feature bits definition used in
HCI_VS_MSFT_Read_Supported_Features.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomonitor/msft: Fix uuid.u128 format
Luiz Augusto von Dentz [Tue, 19 Oct 2021 23:40:20 +0000 (16:40 -0700)]
monitor/msft: Fix uuid.u128 format

128 bits are actually 16 octecs not 8.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoperipheral: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:33 +0000 (10:28 -0700)]
peripheral: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoobexd: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:32 +0000 (10:28 -0700)]
obexd: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomesh: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:31 +0000 (10:28 -0700)]
mesh: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoprofiles/input: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:30 +0000 (10:28 -0700)]
profiles/input: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoprofiles/a2dp: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:29 +0000 (10:28 -0700)]
profiles/a2dp: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoplugins/admin: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:28 +0000 (10:28 -0700)]
plugins/admin: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoattrib-server: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:27 +0000 (10:28 -0700)]
attrib-server: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoadapter: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:26 +0000 (10:28 -0700)]
adapter: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodevice: Fix unchecked return value
Tedd Ho-Jeong An [Mon, 18 Oct 2021 17:28:25 +0000 (10:28 -0700)]
device: Fix unchecked return value

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomgmt-tester: Make use of vhci_set_force_suspend/vhci_set_force_wakeup
Luiz Augusto von Dentz [Fri, 15 Oct 2021 00:45:41 +0000 (17:45 -0700)]
mgmt-tester: Make use of vhci_set_force_suspend/vhci_set_force_wakeup

This replaces the direct setting debugfs to use vhci instance which
properly stores the controller index so it can be used even if there
are real controllers in the system.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agovhci: Add functions to interface with debugfs
Luiz Augusto von Dentz [Fri, 15 Oct 2021 00:25:04 +0000 (17:25 -0700)]
vhci: Add functions to interface with debugfs

This adds functions that can be used to set debugfs options.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agohciemu: Use vhci_open to instanciate a vhci btdev
Luiz Augusto von Dentz [Thu, 14 Oct 2021 22:58:52 +0000 (15:58 -0700)]
hciemu: Use vhci_open to instanciate a vhci btdev

This makes use of vhci_open to isntanciate the vhci btdev since that
has proper support for reading the index assigned to it.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agovhci: Use io.h instead of mainloop.h
Luiz Augusto von Dentz [Thu, 14 Oct 2021 23:29:13 +0000 (16:29 -0700)]
vhci: Use io.h instead of mainloop.h

The likes of mainloop_add_fd is not implemented in mainloop-glib.c while
io_set_read_handler so this makes it possible to use vhci instance with
both libshared-glib and libshared-mainloop.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agovhci: Read the controller index
Luiz Augusto von Dentz [Thu, 14 Oct 2021 21:38:34 +0000 (14:38 -0700)]
vhci: Read the controller index

This makes vhci instance read its controller index assigned by the
kernel and also introduces vhci_get_btdev so it can be used by the
likes of hciemu.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomonitor: Make use of MSFT packet definitions
Luiz Augusto von Dentz [Thu, 14 Oct 2021 00:49:50 +0000 (17:49 -0700)]
monitor: Make use of MSFT packet definitions

This make use of the packet definitions for MSFT extension.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomonitor: Add packet definitions for MSFT extension
Luiz Augusto von Dentz [Tue, 12 Oct 2021 22:48:11 +0000 (15:48 -0700)]
monitor: Add packet definitions for MSFT extension

This adds proper packet definitions for command and response of MSFT
extension.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoRelease 5.62
Marcel Holtmann [Wed, 13 Oct 2021 18:33:40 +0000 (20:33 +0200)]
Release 5.62

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agobuild: Update library version
Marcel Holtmann [Wed, 13 Oct 2021 18:33:29 +0000 (20:33 +0200)]
build: Update library version

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoUse accurate icons for headphones and headsets
Thomas Weißschuh [Sun, 3 Oct 2021 10:18:34 +0000 (12:18 +0200)]
Use accurate icons for headphones and headsets

While these icon names are not part of the spec standard names [0] they
are in practice implemented by at least Adwaita, Gnome, Oxygen, Arc and Breeze
themes.

[0] https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfg-client: Fix NULL pointer dereferencing
Inga Stotland [Fri, 8 Oct 2021 18:48:30 +0000 (11:48 -0700)]
tools/mesh-cfg-client: Fix NULL pointer dereferencing

This patch fixes a number of potential NULL pointer dereferencing
cases.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Add more suspend/resume test cases
Tedd Ho-Jeong An [Fri, 8 Oct 2021 19:36:28 +0000 (12:36 -0700)]
tools/mgmt-tester: Add more suspend/resume test cases

This patch adds more suspend/resuem test cases like
 - Discover -> Suspend
 - Discover -> Suspend -> Resume
 - Suspend -> Resume -> Suspend -> Resume

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Updates Experimental Feature test cases
Tedd Ho-Jeong An [Fri, 8 Oct 2021 19:36:27 +0000 (12:36 -0700)]
tools/mgmt-tester: Updates Experimental Feature test cases

This patch updates/adds test cases for Read and Set Experimental Feature
commands.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc/tester-config: Enable Runtime Debugging Feature
Tedd Ho-Jeong An [Fri, 8 Oct 2021 19:36:26 +0000 (12:36 -0700)]
doc/tester-config: Enable Runtime Debugging Feature

This patch adds CONFIG_BT_FEATURE_DEBUG=y in tester config to enable the
runtime debug option.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotest-hog: Update pdu sequence
Luiz Augusto von Dentz [Wed, 6 Oct 2021 21:34:41 +0000 (14:34 -0700)]
test-hog: Update pdu sequence

With recent changes to use bt_att_resend the procedures such as read
long will group the reads to the same handler before proceeding to the
next procedures.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoattrib: Make use of bt_att_resend
Luiz Augusto von Dentz [Wed, 6 Oct 2021 21:00:15 +0000 (14:00 -0700)]
attrib: Make use of bt_att_resend

If the id != 0 that means that a proceedure that needs multiple PDUs is
in progress so use bt_att_resend with its id that way the bt_att id and
gattrib shall always be the same.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoshared/gatt-client: Make use of bt_att_resend
Luiz Augusto von Dentz [Mon, 4 Oct 2021 21:16:00 +0000 (14:16 -0700)]
shared/gatt-client: Make use of bt_att_resend

This makes use of bt_att_resend when sending continuation of PDUs such
as BT_ATT_OP_READ_BLOB_REQ and BT_ATT_OP_PREP_WRITE_REQ to avoid having
it interleave with other procedures, which is both simpler for the
peripheral to handle as well as it should reduce the lifetime of the
objects used for tracking the state of these procedures.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoshared/att: Add bt_att_resend
Luiz Augusto von Dentz [Mon, 4 Oct 2021 21:14:40 +0000 (14:14 -0700)]
shared/att: Add bt_att_resend

This adds bt_att_resend which can be used with procedures that needs to
send multiple PDUs to complete (e.g. Read Long, Write Long, etc.) so
they are pushed to the head instead of the tail of the queue so one can
retain its position on the queue.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Update the correct suspend reason for disconnect
Tedd Ho-Jeong An [Wed, 6 Oct 2021 02:40:22 +0000 (19:40 -0700)]
tools/mgmt-tester: Update the correct suspend reason for disconnect

This patch fixes the suspend reason for the pairing test cases to the
disconnect.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Fix the suspend reason code
Tedd Ho-Jeong An [Mon, 4 Oct 2021 21:56:30 +0000 (14:56 -0700)]
tools/mgmt-tester: Fix the suspend reason code

This patch fixes the suspend reason code to align with the corrent
kernel implementation.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Add test cases for load_long_term_keys command
Tedd Ho-Jeong An [Thu, 9 Sep 2021 23:09:23 +0000 (16:09 -0700)]
tools/mgmt-tester: Add test cases for load_long_term_keys command

This patch adds extra test cases for load_long_term_keys command.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoclient: Print error code for connect methods
Miao-chen Chou [Thu, 30 Sep 2021 22:37:30 +0000 (15:37 -0700)]
client: Print error code for connect methods

The following steps were performed.
- Issuing repeated commands to connect the same BLE device.
- Verifying the print in bluetoothctl console

Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Howard Chung <howardchung@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodevice: Include detailed error string in Connect() return
Miao-chen Chou [Thu, 30 Sep 2021 22:37:28 +0000 (15:37 -0700)]
device: Include detailed error string in Connect() return

This replaces generic strerror message with context detailed error
string to better indicate the detailed failure reason so that the D-Bus
clients can optimize their application to work better with BlueZ, e.g.
introducing retry mechanism or building metrics.

Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Howard Chung <howardchung@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoerror: BR/EDR and LE connection failure reasons
Miao-chen Chou [Thu, 30 Sep 2021 22:37:26 +0000 (15:37 -0700)]
error: BR/EDR and LE connection failure reasons

The source of Connect() failures can be divided into the following
three.
- bluetoothd's device interface state transition and profile state
  transition
- Kernel's L2CAP layer state transition
- Potential HCI error codes returned by the remote device

Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Howard Chung <howardchung@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc: Add errors.txt to describe errors of D-Bus method returns
Miao-chen Chou [Thu, 30 Sep 2021 22:37:24 +0000 (15:37 -0700)]
doc: Add errors.txt to describe errors of D-Bus method returns

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoadv_monitor: Mark the device as lost on device_lost_timeout
Manish Mandlik [Wed, 22 Sep 2021 01:13:23 +0000 (18:13 -0700)]
adv_monitor: Mark the device as lost on device_lost_timeout

Mark the device as lost on device_lost_timeout so that it can be found
again next time.

Verified this by adding a monitor using bluetoothctl and confirming that
the DeviceLost event is getting triggered when bt peer stops advertising
and DeviceFound event gets triggered again when the bt peer restarts the
advertising.

Reviewed-by: Yun-Hao Chung <howardchung@google.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt: Allow GATT server to dicate CCC permissions
Dagan Martinez [Fri, 1 Oct 2021 14:17:18 +0000 (10:17 -0400)]
gatt: Allow GATT server to dicate CCC permissions

Allow a GATT server to impose write permissions/restrictions on a CCC by
setting additional `X-notify` and `X-indicate` flags on its associated
characteristic.

This allows a developer to require encryption/authentication in order
for a GATT client to subscribe to server-initiated updates.

```
[bluetooth]# register-characteristic\
4b75f0f8-1f23-46b1-900c-5bbabcd5ca93 encrypt-read,encrypt-notify

[NEW] Characteristic (Handle 0x0000)
        /org/bluez/app/service0/chrc17
        4b75f0f8-1f23-46b1-900c-5bbabcd5ca93
        Vendor specific
[/org/bluez/app/service0/chrc17] Enter value: 42
```

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc/gatt-api: Add 'X-notify`/`X-indicate`
Dagan Martinez [Fri, 1 Oct 2021 14:17:19 +0000 (10:17 -0400)]
doc/gatt-api: Add 'X-notify`/`X-indicate`

Update docs to reflect the addition of the `X-notify` and `X-indicate`
characteristic flags, which allow a GATT server to restrict CCC write
permissions.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Add suspend/resume test cases
Tedd Ho-Jeong An [Tue, 28 Sep 2021 01:38:20 +0000 (18:38 -0700)]
tools/mgmt-tester: Add suspend/resume test cases

This patch adds the suspend/resume test cases:

Suspend/Resume - Success 1 (Suspend)
Suspend/Resume - Success 2 (Resume)
Suspend/Resume - Success 3 (Device in WL)
Suspend/Resume - Success 4 (Advertising)
Suspend/Resume - Success 5 (Pairing - Legacy)
Suspend/Resume - Success 6 (Pairing - SSP)

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mgmt-tester: Fix Read Experiemental Feature test case
Tedd Ho-Jeong An [Wed, 29 Sep 2021 21:00:49 +0000 (14:00 -0700)]
tools/mgmt-tester: Fix Read Experiemental Feature test case

The quality report feature is supported only if the device support it.
Current emulator/btdev doesn't support it yet.

This patch updates the supported experimental feature list to align with
the current btdev implementation.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt: Fix not cleaning up when disconnected
Bernie Conrad [Tue, 28 Sep 2021 23:00:15 +0000 (16:00 -0700)]
gatt: Fix not cleaning up when disconnected

There is a current use after free possible on a gatt server if a client
disconnects while a WriteValue call is being processed with dbus.

This patch includes the addition of a pending disconnect callback to handle
cleanup better if a disconnect occurs during a write, an acquire write
or read operation using bt_att_register_disconnect with the cb.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoclient: Print MTU on attribute-info
Luiz Augusto von Dentz [Tue, 28 Sep 2021 23:53:08 +0000 (16:53 -0700)]
client: Print MTU on attribute-info

This prints the MTU of the characteristic when available.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt: Emit PropertiesChanged("MTU") when MTU is exchanged
Luiz Augusto von Dentz [Tue, 28 Sep 2021 23:42:58 +0000 (16:42 -0700)]
gatt: Emit PropertiesChanged("MTU") when MTU is exchanged

This notifies client when the ATT MTU changes.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoshared/att: Add bt_att_register_exchange
Luiz Augusto von Dentz [Tue, 28 Sep 2021 23:07:10 +0000 (16:07 -0700)]
shared/att: Add bt_att_register_exchange

This adds bt_att_register_exchange which can be used to register
handlers that gets notified when the MTU gets changed via MTU exchange
procedure.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt: Add implementation of GattCharacteristic1.MTU
Luiz Augusto von Dentz [Tue, 28 Sep 2021 22:45:05 +0000 (15:45 -0700)]
gatt: Add implementation of GattCharacteristic1.MTU

This implements MTU property in GattCharacteristic1 interface.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt-api: Add MTU property to GattCharacteristic1
Luiz Augusto von Dentz [Tue, 28 Sep 2021 22:42:46 +0000 (15:42 -0700)]
gatt-api: Add MTU property to GattCharacteristic1

This adds MTU properyt to GattCharacteristic1 which can be used in
order to determine how much data can be read/write using non-long
procedures which sometimes is the only thing the remote device
supports.

Fixes: https://github.com/bluez/bluez/issues/199
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc/tester-config: Enable KASAN
Luiz Augusto von Dentz [Mon, 27 Sep 2021 22:20:36 +0000 (15:20 -0700)]
doc/tester-config: Enable KASAN

This patch adds CONFIG_KASAN=y in tester config.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc/tester-config: Enable Android Extension
Luiz Augusto von Dentz [Mon, 27 Sep 2021 22:19:55 +0000 (15:19 -0700)]
doc/tester-config: Enable Android Extension

This patch adds Android Extension in tester config.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc/tester-config: Enable Microsoft Extension
Tedd Ho-Jeong An [Mon, 27 Sep 2021 22:13:07 +0000 (15:13 -0700)]
doc/tester-config: Enable Microsoft Extension

This patch adds Microsoft Extension in tester config.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Export configuration database
Inga Stotland [Thu, 23 Sep 2021 03:26:03 +0000 (20:26 -0700)]
tools/mesh-cfgclient: Export configuration database

This adds main menu command "export-db".
When the command is invoked, JSON configuration object is
cloned and trimmed of extraneous properties.
Information about netkeys, appkeys and device keys are obtained
from bluetooth-meshd by calling ExportKeys() method.
The obtained key values are recorded in the export JSON object.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Excluded addresses property
Inga Stotland [Thu, 23 Sep 2021 03:26:02 +0000 (20:26 -0700)]
tools/mesh-cfgclient: Excluded addresses property

The correct name for a property that contains a list of addresses
not allowed in circulation is "networkExclusions"
The "excluded" property in "nodes" array entry is used to indicated that
this node has been removed from a mesh network and it's address should not
be re-used.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Store UUIDs in standard format
Inga Stotland [Thu, 23 Sep 2021 03:26:01 +0000 (20:26 -0700)]
tools/mesh-cfgclient: Store UUIDs in standard format

Use standard xxxx-xx-xx-xx-xxxxxxxx format for string
representation of mesh and node UUIDs in stored configuration.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agomesh: Implement ExportKeys() method
Inga Stotland [Thu, 23 Sep 2021 03:26:00 +0000 (20:26 -0700)]
mesh: Implement ExportKeys() method

Add implementation for new method ExportKeys() on
org.bluez.mesh.Management1 interface.
This method is used by the authorized application to export information
about network keys, application keys and device keys present in the
local key database.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agodoc/mesh-api: Add ExportKeys call
Inga Stotland [Thu, 23 Sep 2021 03:25:59 +0000 (20:25 -0700)]
doc/mesh-api: Add ExportKeys call

Add description for a new method:
ExportKeys() on org.bluez.mesh.Management1 interface.

This method is used by the authorized application to export information
about network keys, application keys and device keys present in the local
key database.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Add group parent address for DB compliance
Inga Stotland [Thu, 23 Sep 2021 03:25:58 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Add group parent address for DB compliance

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Store remote's heartbeat sub/pub
Inga Stotland [Thu, 23 Sep 2021 03:25:57 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Store remote's heartbeat sub/pub

Store remote node's heartbeat publication or subscription info upon
receiving CONFIG_HEARTBEAT_PUB_STATUS or CONFIG_HEARTBEAT_SUB_STATUS
messages when the messages' status code is set to Success.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Save remote node feature setting
Inga Stotland [Thu, 23 Sep 2021 03:25:56 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Save remote node feature setting

Save the information for remote node's relay, friend, proxy and
secure network beacon settings.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Rename mesh-db APIs for consistency
Inga Stotland [Thu, 23 Sep 2021 03:25:55 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Rename mesh-db APIs for consistency

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Check the result of config save
Inga Stotland [Thu, 23 Sep 2021 03:25:54 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Check the result of config save

After successful completion of configuration commands that change
configuration state of network, the updates are expected to be
recorded in configuration file. If for the results are not saved,
print a warning message.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Store remote's model publication info
Inga Stotland [Thu, 23 Sep 2021 03:25:53 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Store remote's model publication info

Update remote node's model publication after a successful completion
of "pub-set" or "pub-get" commands.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Disallow model commands w/o composition
Inga Stotland [Thu, 23 Sep 2021 03:25:52 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Disallow model commands w/o composition

If remote node's composition hasn't been acquired, disallow commands
that change model state (that is, bindings, subscriptions, publications).
Prompt to run "get-composition" command first.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Store remote node's model subs
Inga Stotland [Thu, 23 Sep 2021 03:25:51 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Store remote node's model subs

Update remote node's model subscriptions after a successful completion
of "sub-add", "sub-del", "sub-wrt" and "sub-del_all" commands.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Store remote node's model bindings
Inga Stotland [Thu, 23 Sep 2021 03:25:50 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Store remote node's model bindings

Update remote node's model binding after a successful completion
of "bind" or "unbind" commands.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Overwrite config values when adding new ones
Inga Stotland [Thu, 23 Sep 2021 03:25:49 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Overwrite config values when adding new ones

This changes common utilities used in mesh-db.c to replace old values
by default whenever a new value is written.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh: Add new info to stored remote nodes
Inga Stotland [Thu, 23 Sep 2021 03:25:48 +0000 (20:25 -0700)]
tools/mesh: Add new info to stored remote nodes

When adding a new remote node into configuration database,
initialize additional default properties:
"excluded": false
"security": "secure"
"configComplete": false

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Keep track of updated keys
Inga Stotland [Thu, 23 Sep 2021 03:25:47 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Keep track of updated keys

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Update stored NetKey and AppKey
Inga Stotland [Thu, 23 Sep 2021 03:25:46 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Update stored NetKey and AppKey

NetKeys:
- Record additional properties: "name", "minSecurity", "timestamp"

AppKeys:
- Record additional property: "name"

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Add timestamp to config database
Inga Stotland [Thu, 23 Sep 2021 03:25:45 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Add timestamp to config database

This adds timestamp property to the configuration database.
The UTC timestamp format: YYYY-MM-DDThh:mm:ssZ

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agotools/mesh-cfgclient: Save provisioner info
Inga Stotland [Thu, 23 Sep 2021 03:25:44 +0000 (20:25 -0700)]
tools/mesh-cfgclient: Save provisioner info

This adds "provisioners" property to the config database.
The property includes the provisioner's name, UUID of the provisioner
device (corresponds to the local node), allocated unicast, group and
scene ranges.
The current implementation limitations:
- only one provisioner in the mesh network is supported,
- the unicast range is assumed to be contiguous,
- the group range is assumed to be contiguous,
- no support for scenes (empty array).

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agogatt: remove superfluous extended properties
Dagan Martinez [Sun, 26 Sep 2021 17:00:39 +0000 (13:00 -0400)]
gatt: remove superfluous extended properties

BlueZ contained superfluous properties that not only did nothing of
value, but needlessly created CEP descriptors for any characteristic
with a secure/encrypted/authenticated flag applied to it.

This actually deviated from the spec(Bluetooth core 5.3, 3.3.3.1) by
setting the reserved bits in the CEPD.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoavrcp: Fix browsing support in SDP record
Luiz Augusto von Dentz [Fri, 24 Sep 2021 21:11:35 +0000 (14:11 -0700)]
avrcp: Fix browsing support in SDP record

Browsing features shall only be marked as supported when ERTM is also
available.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>