summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2018-06-15 13:24:36 +0200
committerAlex Blasche <alexander.blasche@qt.io>2018-06-18 13:56:27 +0000
commit57ab030cdb245750e1043e3c5ca99c4f409cc868 (patch)
tree2634c93c9aa61f3d3a932c3f1589827e906f6137
parent72ead528a7a1102d147e0b511eaf7ddc3416a162 (diff)
Fix QLEController::connectToDevice() on reconnect behavior
If the desired remote peripheral is already connected, the next call to connectToDevice() does not succeed. The code path to handle this situation already exists it was forgotten to emit the relevant connected() signal. This patch fixes the problem. The problem only exists on Bluez 5.42+ platforms which use the DBus central implementation. [ChangeLog][Platform Specific Changes][Linux] Fixed missing emission of QLEController::connected() upon reconnect to already connected device. This affected platforms with Bluez 5.42+ only. Task-number: QTBUG-68911 Change-Id: Ife2f3b41c33a142d6627e433cb3b141ce9b1ff8a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/bluetooth/qlowenergycontroller_bluezdbus.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp
index afc4b8c1..8f001f92 100644
--- a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp
+++ b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp
@@ -289,7 +289,10 @@ void QLowEnergyControllerPrivateBluezDBus::connectToDevice()
if (device->connected() && device->servicesResolved()) {
//connectToDevice is noop
disconnectSignalRequired = true;
+
setState(QLowEnergyController::ConnectedState);
+ Q_Q(QLowEnergyController);
+ emit q->connected();
return;
}