diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-28 10:51:45 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-12-03 10:18:39 +0100 |
commit | 493013ab2b8b89a6f1b7a0b46bbf4cf5465c4502 (patch) | |
tree | 8168c733021137ee31e5203f90b271275b65b7ce /src/bluetooth/qlowenergyservice_osx.mm | |
parent | 828603893f24db24975a327ad8141cb66826b0b0 (diff) | |
download | qtconnectivity-493013ab2b8b89a6f1b7a0b46bbf4cf5465c4502.tar.gz |
QLowEnergyService - ClientCharacteristicConfiguration
Core Bluetooth has a special method to enable/disable char update notifications and
even more - Core Bluetooth does not allow to use writeValue:forDescriptor:
with ClientCharacteristicConfiguration - that's why need this 'workaround'.
Change-Id: I4a01690a76aabf62397321ca6ba22c4abb1c420c
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qlowenergyservice_osx.mm')
-rw-r--r-- | src/bluetooth/qlowenergyservice_osx.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergyservice_osx.mm b/src/bluetooth/qlowenergyservice_osx.mm index 05763811..cb1c1f30 100644 --- a/src/bluetooth/qlowenergyservice_osx.mm +++ b/src/bluetooth/qlowenergyservice_osx.mm @@ -236,7 +236,8 @@ void QLowEnergyService::writeDescriptor(const QLowEnergyDescriptor &descriptor, } if (descriptor.uuid() == QBluetoothUuid::ClientCharacteristicConfiguration) { - // Core Bluetooth: + // We have to identify a special case - ClientCharacteristicConfiguration + // since with Core Bluetooth: // // "You cannot use this method to write the value of a client configuration descriptor // (represented by the CBUUIDClientCharacteristicConfigurationString constant), @@ -244,6 +245,7 @@ void QLowEnergyService::writeDescriptor(const QLowEnergyDescriptor &descriptor, // characteristic’s value with respect to a client. If you want to manage // notifications or indications for a characteristic’s value, you must // use the setNotifyValue:forCharacteristic: method instead." + controller->setNotifyValue(descriptor.d_ptr, descriptor.characteristicHandle(), newValue); } else { controller->writeDescriptor(descriptor.d_ptr, descriptor.handle(), newValue); } |