diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-04-07 15:22:00 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-04-07 15:22:00 +0300 |
commit | 83ca3a2471560f09d723157322adc0b5c33ed914 (patch) | |
tree | 565dd202b8245ffc41c5697ea9e1069781d43e01 /src/bluetooth/qlowenergycontroller_bluezdbus.cpp | |
parent | 4dcb2f232e00836830dcbffdc5dafbcde6607c08 (diff) | |
parent | 5466df6f9b9237caba71a3ae323b931de1f7eda9 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Change-Id: I86f7492c32a43094f37cfb9b21ad1066aa49ba68
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_bluezdbus.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluezdbus.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp index d69fb6cd..c159e97e 100644 --- a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp +++ b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp @@ -60,6 +60,9 @@ QLowEnergyControllerPrivateBluezDBus::QLowEnergyControllerPrivateBluezDBus() QLowEnergyControllerPrivateBluezDBus::~QLowEnergyControllerPrivateBluezDBus() { + if (state != QLowEnergyController::UnconnectedState) { + qCWarning(QT_BT_BLUEZ) << "Low Energy Controller deleted while connected."; + } } void QLowEnergyControllerPrivateBluezDBus::init() @@ -208,12 +211,17 @@ void QLowEnergyControllerPrivateBluezDBus::characteristicPropertiesChanged( emit service->characteristicChanged(changedChar, newValue); } -void QLowEnergyControllerPrivateBluezDBus::interfacesRemoved( - const QDBusObjectPath &objectPath, const QStringList &/*interfaces*/) +void QLowEnergyControllerPrivateBluezDBus::interfacesRemoved(const QDBusObjectPath &objectPath, + const QStringList &interfaces) { if (objectPath.path() == device->path()) { - qCWarning(QT_BT_BLUEZ) << "DBus Device1 was removed"; - executeClose(QLowEnergyController::UnknownRemoteDeviceError); + if (interfaces.contains(QStringLiteral("org.bluez.Device1"))) { + qCWarning(QT_BT_BLUEZ) << "DBus Device1 was removed"; + executeClose(QLowEnergyController::UnknownRemoteDeviceError); + } else { + qCDebug(QT_BT_BLUEZ) << "DBus interfaces" << interfaces << "were removed from" + << objectPath.path(); + } } else if (objectPath.path() == adapter->path()) { qCWarning(QT_BT_BLUEZ) << "DBus Adapter was removed"; executeClose(QLowEnergyController::InvalidBluetoothAdapterError); @@ -385,6 +393,8 @@ void QLowEnergyControllerPrivateBluezDBus::disconnectFromDevice() qCDebug(QT_BT_BLUEZ) << "BTLE_DBUS::disconnect() failed" << reply.reply().errorName() << reply.reply().errorMessage(); + executeClose(QLowEnergyController::UnknownError); + } else { executeClose(QLowEnergyController::NoError); } call->deleteLater(); |