Commit Graph

26156 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
3a6b5f5ec1 gatt: Emit PropertiesChanged("MTU") when MTU is exchanged
This notifies client when the ATT MTU changes.
2021-09-28 16:42:58 -07:00
Luiz Augusto von Dentz
9bb8fbe51a 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.
2021-09-28 16:07:10 -07:00
Luiz Augusto von Dentz
aaa0c4996a gatt: Add implementation of GattCharacteristic1.MTU
This implements MTU property in GattCharacteristic1 interface.
2021-09-28 15:45:05 -07:00
Luiz Augusto von Dentz
1abf1400fa 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
2021-09-28 15:42:46 -07:00
Luiz Augusto von Dentz
756fbd5ebd doc/tester-config: Enable KASAN
This patch adds CONFIG_KASAN=y in tester config.
2021-09-27 15:27:51 -07:00
Luiz Augusto von Dentz
2df3bba5b7 doc/tester-config: Enable Android Extension
This patch adds Android Extension in tester config.
2021-09-27 15:27:51 -07:00
Tedd Ho-Jeong An
f2db5c7afd doc/tester-config: Enable Microsoft Extension
This patch adds Microsoft Extension in tester config.
2021-09-27 15:27:51 -07:00
Inga Stotland
91c9329a05 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.
2021-09-27 13:22:40 -07:00
Inga Stotland
7514aa8d9c 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.
2021-09-27 13:22:40 -07:00
Inga Stotland
1616e4883f 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.
2021-09-27 13:22:40 -07:00
Inga Stotland
eb642a59fb 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
1dc1106895 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
4e16431a51 tools/mesh-cfgclient: Add group parent address for DB compliance 2021-09-27 13:22:39 -07:00
Inga Stotland
55f91fd373 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
725ad808fd tools/mesh-cfgclient: Save remote node feature setting
Save the information for remote node's relay, friend, proxy and
secure network beacon settings.
2021-09-27 13:22:39 -07:00
Inga Stotland
8525542fa7 tools/mesh-cfgclient: Rename mesh-db APIs for consistency 2021-09-27 13:22:39 -07:00
Inga Stotland
278805887d 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
8dc6b45207 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
d66d3d34f9 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
5d14cbc2d5 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
aabda1e487 tools/mesh-cfgclient: Store remote node's model bindings
Update remote node's model binding after a successful completion
of "bind" or "unbind" commands.
2021-09-27 13:22:39 -07:00
Inga Stotland
87d13379a5 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.
2021-09-27 13:22:39 -07:00
Inga Stotland
e01a82948f 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
2021-09-27 13:22:39 -07:00
Inga Stotland
d4e093b54f tools/mesh-cfgclient: Keep track of updated keys 2021-09-27 13:22:39 -07:00
Inga Stotland
ad1ecb0ad8 tools/mesh-cfgclient: Update stored NetKey and AppKey
NetKeys:
- Record additional properties: "name", "minSecurity", "timestamp"

AppKeys:
- Record additional property: "name"
2021-09-27 13:22:39 -07:00
Inga Stotland
a3054bda48 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
2021-09-27 13:22:39 -07:00
Inga Stotland
c3da135524 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).
2021-09-27 13:22:39 -07:00
Dagan Martinez
7d4f408839 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.
2021-09-27 10:34:41 -07:00
Luiz Augusto von Dentz
5c0857665b avrcp: Fix browsing support in SDP record
Browsing features shall only be marked as supported when ERTM is also
available.
2021-09-24 14:17:54 -07:00
Luiz Augusto von Dentz
2dd006d264 avctp: Fix not handling when kernel has ERTM disabled
If kernel module is loaded with disable_ertm ERTM won't be available
thus browsing channel won't be able to be created, but it shall be
possible to still use AVRCP without it.

Fixes: https://github.com/bluez/bluez/issues/209
2021-09-24 14:17:28 -07:00
Archie Pusaka
0ba16aa232 device: Check both bearers's paired status upon removal of connection
Because Link Key for BREDR can be transformed into LTK for LE (and
vice versa), there is a possibility of getting 'paired' on either of
BREDR/LE without actually connected using the aforementioned bearer.

When removing the connection, we should check both bearers's paired
and bonded status rather than just the one getting disconnected.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
2021-09-23 16:20:28 -07:00
Luiz Augusto von Dentz
838741b884 adapter: Truncate number of LTKs loaded if over MGMT MTU
If MGMT MTU cannot accomodate all the existing LTKs only send the ones
that fit in the MTU and leave the remaining as unpaired.
2021-09-22 14:32:38 -07:00
Luiz Augusto von Dentz
ebb9c448ab shared/mgmt: Add mgmt_get_mtu
This adds mgmt_get_mtu function which can be used to query the
transport MTU.
2021-09-22 14:32:38 -07:00
Luiz Augusto von Dentz
023492834d lib: Fix HCI_MAX_ACL_SIZE
HCI_MAX_ACL_SIZE actually includes the maximum frames in AMP controller
so this changes it to properly define the max ACL frames on non-AMP
controllers and introduces a dedicated define for AMP controller as
HCI_MAX_AMP_SIZE.
2021-09-22 14:32:38 -07:00
Luiz Augusto von Dentz
c605e115dd shared/mgmt: Set MTU to UINT16_MAX
This sets MTU of MGMT socket to UINT16_MAX since some commands may
require more than the default size (e.g. Load LTKs).

Fixes: https://github.com/bluez/bluez/issues/201
2021-09-22 14:32:37 -07:00
Archie Pusaka
9ee79f67be doc: Inclusive language update
Update the docs to reflect the changes for the other inclusive
language updates.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
b21e112441 unit/mesh: Inclusive language changes
According to
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf
"flooding" is the preferred term.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
09f87c80f1 mesh: Inclusive language changes
According to
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf
"flooding", "accept list", and "reject list" are the preferred terms.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
28a5c47650 client: Inclusive language changes
Use "parent" to describe dbus hierarchy.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
7dd00605d1 src: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL replaces some terms with the more appropriate counterparts,
such as "central", "peripheral", "accept list", and "reject list".
Note that some suggestions come from
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf

Also use "primary" to refer the global mgmt struct.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
d21177002d profiles: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL replaces some terms with the more appropriate counterparts,
such as "central" and "peripheral".

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
e5af955ef8 plugins/sixaxis: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL uses "central" as it is deemed to be more appropriate.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
9509056e8d tools: Deprecate some input parameters to align with inclusive language
Some input parameter names are not appropriate and needs to be
updated. However, doing so might cause friction with the current
workflow and documents.

This patch deprecates the inappropriate names and replaces them with
the more appropriate substitutes, while still keeping the old terms
usable to not break the workflow of users.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
43f547d7e5 tools: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL replaces some terms with the more appropriate counterparts,
such as "central", "peripheral", "accept list", "reject list", and
"temporary link key". Note that some suggestions come from
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
048f2ac0e4 emulator: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL replaces some terms with the more appropriate counterparts,
such as "central", "peripheral", and "accept list".

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
7582f36071 monitor: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL replaces some terms with the more appropriate counterparts,
such as "central", "peripheral", "link key", and "accept list"

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Archie Pusaka
a777d7d535 btio: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL uses "central" as it is deemed to be more appropriate.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:53 +02:00
Archie Pusaka
b7d6a7d256 lib: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages.
This CL replaces some terms with the more appropriate counterparts,
such as "central", "peripheral", and "accept list".

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:53 +02:00
Luiz Augusto von Dentz
62182e0fcc media: Add media_player prefix for callback
This adds media_player prefix to callback so it is inline with pause
which now uses such callback due to possible clash with libc
definition.
2021-09-17 13:50:45 -07:00
Fabrice Fontaine
415af69b25 media: Fix build with glibc >= 2.34
pause() is defined in glibc since the very early times; it appears in
upstream commit 28f540f45bba (initial import) in 1995 [0].

Bluez has been defining a function named pause() for ages too, since
commit caab74c975 (media: Implement new callbacks for pass-through
operations) in 2013 [1]

With the recent bump to glibc 2.34.xxx, the build now fails because the
two pause() clash:

profiles/audio/media.c:1284:13: error: conflicting types for 'pause'
 1284 | static bool pause(void *user_data)
      |             ^~~~~
In file included from /tmp/instance-0/output-1/per-package/bluez5_utils/host/s390x-buildroot-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24,
                 from /tmp/instance-0/output-1/per-package/bluez5_utils/host/s390x-buildroot-linux-gnu/sysroot/usr/include/signal.h:328,
                 from /tmp/instance-0/output-1/per-package/bluez5_utils/host/bin/../s390x-buildroot-linux-gnu/sysroot/usr/include/glib-2.0/glib/gbacktrace.h:36,
                 from /tmp/instance-0/output-1/per-package/bluez5_utils/host/bin/../s390x-buildroot-linux-gnu/sysroot/usr/include/glib-2.0/glib.h:34,
                 from profiles/audio/media.c:21:
/tmp/instance-0/output-1/per-package/bluez5_utils/host/s390x-buildroot-linux-gnu/sysroot/usr/include/unistd.h:489:12: note: previous declaration of 'pause' was here
  489 | extern int pause (void);
      |            ^~~~~

The culprit is indeed glibc 2.34, as can be seen in this result matrix:

         \   bluez5_utils
    glibc \  5.60  |  5.61
    -------\-------+--------
    2.33   |  OK   |   OK
    -------+-------+--------
    2.34   |  KO   |   KO

The underlying reason that pause() is now causing issues with glibc 2.34
is not obvious: glibc is a big beast, and finding such issues is not
easy. However, we can see that the pause() provided by NPTL has been
dropped in favour of the generic one, so maybe this is causing symbol
visibility or weakness to change or something...

We fix that by renaming the local pause() in bluez5_utils with a
namespace-prefix, like some other functions there already have.

Fixes:
  - http://autobuild.buildroot.org/results/c4fbface34be8815838fd7201621d7a8fddd32c5
  - http://autobuild.buildroot.org/results/62b88740f19fbe4a1ad7959dc141d539eb88c1f8

[0] https://sourceware.org/git/?p=glibc.git;a=commit;h=28f540f45bbacd939bfd07f213bcad2bf730b1bf
[1] caab74c975
2021-09-17 13:41:35 -07:00