From d21201f0536230848e419b71bdd2d025b3ae1468 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 4 Dec 2014 13:25:06 +0100 Subject: 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 --- src/bluetooth/qlowenergycontroller_osx.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3