diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-23 18:02:09 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-26 13:00:34 +0100 |
commit | be750788c7f5276b0a8686e1f11bf4ca12ee9231 (patch) | |
tree | 17d95e86ba063fad3193f5291fe0fd9db0bfb9f3 /src/bluetooth/qlowenergycontroller_osx_p.h | |
parent | 9966c69e301a041ad224ef08bc3da45ca249041d (diff) |
QLowEnergyService::writeCharacteristic - implementation for OS X and iOS
writeCharacteristic - implemented with Core Bluetooth for OS X and iOS.
Change-Id: Ia228ff451e1e6d7b6fb7de6cad29198aa9257602
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 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx_p.h b/src/bluetooth/qlowenergycontroller_osx_p.h index f9764c03..a8f8aaa0 100644 --- a/src/bluetooth/qlowenergycontroller_osx_p.h +++ b/src/bluetooth/qlowenergycontroller_osx_p.h @@ -34,6 +34,7 @@ #ifndef QLOWENERGYCONTROLLER_OSX_P_H #define QLOWENERGYCONTROLLER_OSX_P_H +#include "qlowenergyserviceprivate_p.h" #include "osx/osxbtcentralmanager_p.h" #include "qlowenergycontroller_p.h" #include "qlowenergycontroller.h" @@ -41,6 +42,7 @@ #include "qbluetoothaddress.h" #include "qbluetoothuuid.h" +#include <QtCore/qsharedpointer.h> #include <QtCore/qglobal.h> #include <QtCore/qstring.h> #include <QtCore/qmap.h> @@ -52,6 +54,7 @@ class QLowEnergyControllerPrivateOSX : public QLowEnergyControllerPrivate, public OSXBluetooth::CentralManagerDelegate { friend class QLowEnergyController; + friend class QLowEnergyService; public: QLowEnergyControllerPrivateOSX(QLowEnergyController *q); QLowEnergyControllerPrivateOSX(QLowEnergyController *q, @@ -67,15 +70,36 @@ private: void serviceDiscoveryFinished(LEServices services) Q_DECL_OVERRIDE; void serviceDetailsDiscoveryFinished(LEService service) Q_DECL_OVERRIDE; + void characteristicWriteNotification(LECharacteristic ch) Q_DECL_OVERRIDE; void disconnected() Q_DECL_OVERRIDE; void error(QLowEnergyController::Error errorCode) Q_DECL_OVERRIDE; void error(const QBluetoothUuid &serviceUuid, QLowEnergyController::Error errorCode) Q_DECL_OVERRIDE; + void error(const QBluetoothUuid &serviceUuid, + QLowEnergyHandle charHandle, + QLowEnergyService::ServiceError error) Q_DECL_OVERRIDE; void connectToDevice(); void discoverServices(); void discoverServiceDetails(const QBluetoothUuid &serviceUuid); + void writeCharacteristic(QSharedPointer<QLowEnergyServicePrivate> service, + QLowEnergyHandle charHandle, const QByteArray &newValue, + bool writeWithResponse); + + quint16 updateValueOfCharacteristic(QLowEnergyHandle charHandle, + const QByteArray &value, + bool appendValue); + + void writeDescriptor(QSharedPointer<QLowEnergyServicePrivate> service, + QLowEnergyHandle charHandle, const QLowEnergyHandle descriptorHandle, + const QByteArray &newValue); + + + // 'Lookup' functions: + QSharedPointer<QLowEnergyServicePrivate> serviceForHandle(QLowEnergyHandle serviceHandle); + QLowEnergyCharacteristic characteristicForHandle(QLowEnergyHandle charHandle); + void setErrorDescription(QLowEnergyController::Error errorCode); void invalidateServices(); |