summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-23 11:32:03 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-31 05:27:45 +0000
commit9c60bf6d13c104f512d4dc5b99056b3b6f924fe6 (patch)
tree4ed0d84ba69b1f3cb6383b77d0ccdbb91b334f47 /src/bluetooth
parentdd5054b4b448ddab9fbd3c1b496fa56424a0d3dd (diff)
Do not assert if encryption change was requested by somebody else
This can happen if the QLowEnergyController was created, connected, disconnected and last but not least a second app reconnects. Direct BTLE device interaction with bluetoothctl can cause this. Change-Id: I4a2c68a018b7eb9b866a54cc127e03f6c4bf6672 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Diffstat (limited to 'src/bluetooth')
-rw-r--r--src/bluetooth/qlowenergycontroller_bluez.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp
index f061dba8..1a3066df 100644
--- a/src/bluetooth/qlowenergycontroller_bluez.cpp
+++ b/src/bluetooth/qlowenergycontroller_bluez.cpp
@@ -392,10 +392,12 @@ void QLowEnergyControllerPrivate::l2cpReadyRead()
void QLowEnergyControllerPrivate::encryptionChangedEvent(
const QBluetoothAddress &address, bool wasSuccess)
{
+ if (!encryptionChangePending) // somebody else caused change event
+ return;
+
if (remoteDevice != address)
return;
- Q_ASSERT(encryptionChangePending);
securityLevelValue = securityLevel();
// On success continue to process ATT command queue