diff options
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_android.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_android.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bluetooth/qlowenergycontroller_android.cpp b/src/bluetooth/qlowenergycontroller_android.cpp index 9be5cff0..e1b668ca 100644 --- a/src/bluetooth/qlowenergycontroller_android.cpp +++ b/src/bluetooth/qlowenergycontroller_android.cpp @@ -431,7 +431,10 @@ void QLowEnergyControllerPrivate::characteristicWritten( return; } - updateValueOfCharacteristic(charHandle, data, false); + // only update cache when property is readable. Otherwise it remains + // empty. + if (characteristic.properties() & QLowEnergyCharacteristic::Read) + updateValueOfCharacteristic(charHandle, data, false); emit service->characteristicWritten(characteristic, data); } @@ -479,7 +482,10 @@ void QLowEnergyControllerPrivate::characteristicChanged( return; } - updateValueOfCharacteristic(characteristic.attributeHandle(), + // only update cache when property is readable. Otherwise it remains + // empty. + if (characteristic.properties() & QLowEnergyCharacteristic::Read) + updateValueOfCharacteristic(characteristic.attributeHandle(), data, false); emit service->characteristicChanged(characteristic, data); } |