summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-12-04 14:37:37 +0100
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-12-05 08:50:28 +0100
commita7e67ace12d71162583b00b306060d21ad0a5580 (patch)
treed7f3529add3c9e9f4a89c33370f90f5a5dada336 /src/bluetooth/osx
parentffbb91da8e8f14d7d5ffa8bbeace3e6c42eb525b (diff)
Client characteristic configuration (OS X and iOS)
If client characteristic configuration descriptor has an indication/notification bit set - enable ("automatically" == no explicit user's request) notifications. Change-Id: I839aabd6f5513141f66c8e4467618b3edd523350 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/osx')
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm
index 73d9d5bc..733d73a6 100644
--- a/src/bluetooth/osx/osxbtcentralmanager.mm
+++ b/src/bluetooth/osx/osxbtcentralmanager.mm
@@ -530,6 +530,11 @@ using namespace QT_NAMESPACE;
newDesc.uuid = qt_uuid(d.UUID);
newDesc.value = qt_bytearray(static_cast<NSObject *>(d.value));
descList[lastValidHandle] = newDesc;
+ // Check, if it's client characteristic configuration descriptor:
+ if (newDesc.uuid == QBluetoothUuid::ClientCharacteristicConfiguration) {
+ if (newDesc.value.size() && (newDesc.value[0] & 3))
+ [peripheral setNotifyValue:YES forCharacteristic:c];
+ }
}
newChar.descriptorList = descList;