summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/bluez
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2019-01-02 13:24:56 +0100
committerAlex Blasche <alexander.blasche@qt.io>2019-01-04 07:42:05 +0000
commitfb03b1e921e641a106722f8f3d59861ce7e6789e (patch)
treef85d1bc4c1e8646789d2a054a835dd6f270c48bd /src/bluetooth/bluez
parent193e53e544ebbb5ee60d4ad798648df345679e5a (diff)
Add missing dbus registrations and change documentation
Qt DBus registration for Bluez specific types was done by isBluez5(). However Qt 5.12 introduced bluetoothdVersion() which is a bit more precise. It became necessary because runtime decisions based on exact minor release versions of Bluez became necessary. Therefore some code paths (depending on the user's use case) never called isBluez5() anymore. Subsequently the dbus registrations were missed out on. In the future isBLuez5() should be replaced by bluetoothdVersion(). QBluetoothSocket changed its underlying implementation when addressing QTBUG-68550. It uses dbus sockets to establish rfcomm socket connections to remote devices. The QBluetoothSocket::connectToService() overload that expects a port number is no longer possible as Bluez DBus API does not support connection establishment based on port numbers. Fixes: QTBUG-72742 Change-Id: If6adb391b0524cabc3a702d761e0cbd263508396 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/bluetooth/bluez')
-rw-r--r--src/bluetooth/bluez/bluez5_helper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bluetooth/bluez/bluez5_helper.cpp b/src/bluetooth/bluez/bluez5_helper.cpp
index bacdfe3c..7ce67690 100644
--- a/src/bluetooth/bluez/bluez5_helper.cpp
+++ b/src/bluetooth/bluez/bluez5_helper.cpp
@@ -195,6 +195,13 @@ bool mandatoryHciIoctlsAvailable()
QVersionNumber bluetoothdVersion()
{
if (bluezDaemonVersion()->isNull()) {
+ // Register DBus specific meta types (copied from isBluez5())
+ // Not all code paths run through isBluez5() but still need the
+ // registration.
+ qDBusRegisterMetaType<InterfaceList>();
+ qDBusRegisterMetaType<ManagedObjectList>();
+ qDBusRegisterMetaType<ManufacturerDataList>();
+
qCDebug(QT_BT_BLUEZ) << "Detecting bluetoothd version";
//Order of matching
// 1. Pick whatever the user decides via BLUETOOTH_FORCE_DBUS_LE_VERSION