summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx/osxbtcentralmanager_p.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-11-23 18:02:09 +0100
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-11-26 13:00:34 +0100
commitbe750788c7f5276b0a8686e1f11bf4ca12ee9231 (patch)
tree17d95e86ba063fad3193f5291fe0fd9db0bfb9f3 /src/bluetooth/osx/osxbtcentralmanager_p.h
parent9966c69e301a041ad224ef08bc3da45ca249041d (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/osx/osxbtcentralmanager_p.h')
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager_p.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtcentralmanager_p.h b/src/bluetooth/osx/osxbtcentralmanager_p.h
index 25faab78..1e3028d6 100644
--- a/src/bluetooth/osx/osxbtcentralmanager_p.h
+++ b/src/bluetooth/osx/osxbtcentralmanager_p.h
@@ -43,6 +43,7 @@
#define OSXBTCENTRALMANAGER_P_H
#include "qlowenergycontroller.h"
+#include "qlowenergyservice.h"
#include "qbluetoothuuid.h"
#include "osxbtutility_p.h"
@@ -66,6 +67,7 @@ public:
typedef QT_MANGLE_NAMESPACE(OSXBTCentralManager) ObjCCentralManager;
typedef ObjCStrongReference<NSArray> LEServices;
typedef ObjCStrongReference<CBService> LEService;
+ typedef ObjCStrongReference<CBCharacteristic> LECharacteristic;
virtual ~CentralManagerDelegate();
@@ -73,6 +75,7 @@ public:
virtual void connectSuccess() = 0;
virtual void serviceDiscoveryFinished(LEServices services) = 0;
virtual void serviceDetailsDiscoveryFinished(LEService service) = 0;
+ virtual void characteristicWriteNotification(LECharacteristic ch) = 0;
virtual void disconnected() = 0;
// General errors.
@@ -80,6 +83,10 @@ public:
// Service related errors.
virtual void error(const QBluetoothUuid &serviceUuid,
QLowEnergyController::Error error) = 0;
+ // Characteristics related errors.
+ virtual void error(const QBluetoothUuid &serviceUuid,
+ QLowEnergyHandle charHandle,
+ QLowEnergyService::ServiceError error) = 0;
};
enum CentralManagerState
@@ -133,6 +140,14 @@ QT_END_NAMESPACE
- (void)discoverServices;
- (bool)discoverServiceDetails:(const QT_PREPEND_NAMESPACE(QBluetoothUuid) &)serviceUuid;
+// Characteristic's handle here is a 'relative' == valueHandle - service->startHandle
+// to simplify mapping between Qt's handles and Core Bluetooth's data structures.
+- (bool)write:(const QT_PREPEND_NAMESPACE(QByteArray) &)value
+ characteristic:(QT_PREPEND_NAMESPACE(QLowEnergyHandle))charHandle
+ serviceUuid:(const QT_PREPEND_NAMESPACE(QBluetoothUuid) &)serviceUuid
+ serviceHandle:(QT_PREPEND_NAMESPACE(QLowEnergyHandle))serviceHandle
+ withResponse:(bool)writeWithResponse;
+
@end
#endif