diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/osx/osxbtcentralmanager.mm | 5 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx.mm | 7 |
2 files changed, 10 insertions, 2 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; diff --git a/src/bluetooth/qlowenergycontroller_osx.mm b/src/bluetooth/qlowenergycontroller_osx.mm index ea22ac36..cde11f67 100644 --- a/src/bluetooth/qlowenergycontroller_osx.mm +++ b/src/bluetooth/qlowenergycontroller_osx.mm @@ -344,8 +344,11 @@ void QLowEnergyControllerPrivateOSX::characteristicUpdateNotification(QLowEnergy ServicePrivate service(serviceForHandle(charHandle)); if (service.isNull()) { - qCWarning(QT_BT_OSX) << "QLowEnergyControllerPrivateOSX::characteristicUpdateNotification(), " - "can not find service for characteristic handle " << charHandle; + // This can be an error (no characteristic found for this handle), + // it can also be that we set notify value before the service + // was reported (serviceDetailsDiscoveryFinished) - this happens, + // if we read a descriptor (characteristic client configuration), + // and it's (pre)set. return; } |