diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2015-04-10 13:42:06 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-04-20 11:21:35 +0000 |
commit | b08fc0c605aa4e2f77d716f2e039af29dde9e243 (patch) | |
tree | 07022c1586507cd354fc9a9009d9dcb44f44214b /src/bluetooth/qlowenergycontroller_osx_p.h | |
parent | 2d4f7fd1f8d29175c8dab88a6d6cc72162511e1a (diff) |
Bluetooth LE - add readCharacteristic/readDescriptor (OS X/iOS)
Add read descriptor/characteristic support for iOS and OS X.
Change-Id: If7547f3756dc37930052c9cefd243d6063bcab1c
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_osx_p.h')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx_p.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx_p.h b/src/bluetooth/qlowenergycontroller_osx_p.h index d9457217..96af6db0 100644 --- a/src/bluetooth/qlowenergycontroller_osx_p.h +++ b/src/bluetooth/qlowenergycontroller_osx_p.h @@ -72,10 +72,14 @@ private: void serviceDiscoveryFinished(LEServices services) Q_DECL_OVERRIDE; void serviceDetailsDiscoveryFinished(LEService service) Q_DECL_OVERRIDE; + void characteristicReadNotification(QLowEnergyHandle charHandle, + const QByteArray &value) Q_DECL_OVERRIDE; void characteristicWriteNotification(QLowEnergyHandle charHandle, const QByteArray &newValue) Q_DECL_OVERRIDE; void characteristicUpdateNotification(QLowEnergyHandle charHandle, const QByteArray &value) Q_DECL_OVERRIDE; + void descriptorReadNotification(QLowEnergyHandle descHandle, + const QByteArray &value) Q_DECL_OVERRIDE; void descriptorWriteNotification(QLowEnergyHandle descHandle, const QByteArray &newValue) Q_DECL_OVERRIDE; void disconnected() Q_DECL_OVERRIDE; @@ -89,9 +93,14 @@ private: void discoverServices(); void discoverServiceDetails(const QBluetoothUuid &serviceUuid); + // TODO: all these read/write /setNotify can be simplified - + // by just passing either characteristic or descriptor (that + // has all needed information - service, handle, etc.). void setNotifyValue(QSharedPointer<QLowEnergyServicePrivate> service, QLowEnergyHandle charHandle, const QByteArray &newValue); + void readCharacteristic(QSharedPointer<QLowEnergyServicePrivate> service, + QLowEnergyHandle charHandle); void writeCharacteristic(QSharedPointer<QLowEnergyServicePrivate> service, QLowEnergyHandle charHandle, const QByteArray &newValue, bool writeWithResponse); @@ -100,6 +109,8 @@ private: const QByteArray &value, bool appendValue); + void readDescriptor(QSharedPointer<QLowEnergyServicePrivate> service, + QLowEnergyHandle charHandle); void writeDescriptor(QSharedPointer<QLowEnergyServicePrivate> service, QLowEnergyHandle descriptorHandle, const QByteArray &newValue); |