diff options
author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-02-12 13:07:54 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-12 18:22:29 +0000 |
commit | b7a2cc8339335f2888186f8a179ccbe859f6f2af (patch) | |
tree | 9ac7a0ce8feadeb13c90734961a724c78e587dde | |
parent | 0db3b38521e11147cb802798a2cb7811a96029a9 (diff) |
Add server role to BlueZ service registration
In service registration, a profile is created. This profile had
no clien/server flag. If two profiles with the same UUID are
created (one for server side, one for client side) this led to
the wrong profile being used in connection setup.
This patch marks the profile which is created in registerService()
as a server profile which prevents it from being used by BlueZ
in a client context.
Change-Id: I95b22657a7c7e45b334476a8513d79920ba9cc96
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit e74cb54a4cbc8aba188ea48ae3effcf10432df11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/bluetooth/qbluetoothserviceinfo_bluez.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp index 03ca26e4..a50ce47c 100644 --- a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp +++ b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp @@ -297,6 +297,7 @@ bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress &loca QVariantMap mapping; mapping.insert(QStringLiteral("ServiceRecord"), xmlServiceRecord); + mapping.insert(QStringLiteral("Role"), QStringLiteral("server")); // Strategy to pick service uuid // 1.) use serviceUuid() |