summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-12-04 13:25:06 +0100
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-12-04 16:08:11 +0100
commitd21201f0536230848e419b71bdd2d025b3ae1468 (patch)
treeffc5eaf9fbaf18b80fd9f61aa12aad665a2d9746 /src
parent1169df5311cf4f3c13d232ed2cba810725877e08 (diff)
QLowEnergyCharacteristic - cached values (OS X and iOS)
Cache a characteristic's value in update/write notification only if characteristic has a 'Read' property. Change-Id: Idc705e0c4f2ee704a80bf37b4e59e1dd09ca9e4f Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qlowenergycontroller_osx.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx.mm b/src/bluetooth/qlowenergycontroller_osx.mm
index 48e144cc..ea22ac36 100644
--- a/src/bluetooth/qlowenergycontroller_osx.mm
+++ b/src/bluetooth/qlowenergycontroller_osx.mm
@@ -328,7 +328,9 @@ void QLowEnergyControllerPrivateOSX::characteristicWriteNotification(QLowEnergyH
return;
}
- updateValueOfCharacteristic(charHandle, value, false);
+ if (characteristic.properties() & QLowEnergyCharacteristic::Read)
+ updateValueOfCharacteristic(charHandle, value, false);
+
emit service->characteristicWritten(characteristic, value);
}
@@ -354,7 +356,9 @@ void QLowEnergyControllerPrivateOSX::characteristicUpdateNotification(QLowEnergy
return;
}
- updateValueOfCharacteristic(charHandle, value, false);
+ if (characteristic.properties() & QLowEnergyCharacteristic::Read)
+ updateValueOfCharacteristic(charHandle, value, false);
+
emit service->characteristicChanged(characteristic, value);
}