diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-10-26 16:25:43 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-11-20 16:35:36 +0000 |
commit | 83c826261d6d6bf9180857c9a9cff3f78b63378d (patch) | |
tree | 4c10c7d5341044f75a16e423cfdb8a9dcc969934 /src/bluetooth/qlowenergycontroller_p.h | |
parent | 57353d3f91f89e6e364b9798277048e25b9c63b8 (diff) |
Bluetooth: Add API to set up GATT services.
This is the next step in implementing LE peripheral support.
Change-Id: I5e8cb186d556e7bfb9ae8a5e60e051ff7398b77d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_p.h')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_p.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_p.h b/src/bluetooth/qlowenergycontroller_p.h index d91c2c73..912e7906 100644 --- a/src/bluetooth/qlowenergycontroller_p.h +++ b/src/bluetooth/qlowenergycontroller_p.h @@ -66,6 +66,7 @@ QT_END_NAMESPACE #include <qglobal.h> #include <QtCore/QQueue> #include <QtBluetooth/qbluetooth.h> +#include <QtBluetooth/qlowenergycharacteristic.h> #include "qlowenergycontroller.h" #include "qlowenergyserviceprivate_p.h" @@ -76,8 +77,12 @@ QT_END_NAMESPACE #include "android/lowenergynotificationhub_p.h" #endif +#include <functional> + QT_BEGIN_NAMESPACE +class QLowEnergyServiceData; + #if defined(QT_BLUEZ_BLUETOOTH) && !defined(QT_BLUEZ_NO_BTLE) class HciManager; class QSocketNotifier; @@ -146,6 +151,8 @@ public: const QLowEnergyHandle descriptorHandle, const QByteArray &newValue); + void addToGenericAttributeList(const QLowEnergyServiceData &service, + QLowEnergyHandle startHandle); QBluetoothAddress remoteDevice; QBluetoothAddress localAdapter; @@ -160,6 +167,21 @@ public: // list of all found service uuids ServiceDataMap serviceList; + QLowEnergyHandle lastLocalHandle; + ServiceDataMap localServices; + + struct Attribute { + Attribute() : handle(0) {} + + QLowEnergyHandle handle; + QLowEnergyHandle groupEndHandle; + QLowEnergyCharacteristic::PropertyTypes properties; + QBluetoothUuid type; + QByteArray value; + // TODO: authentication/authorization requirements + }; + QVector<Attribute> localAttributes; + QLowEnergyController::RemoteAddressType addressType; private: @@ -251,6 +273,8 @@ private: }; +Q_DECLARE_TYPEINFO(QLowEnergyControllerPrivate::Attribute, Q_MOVABLE_TYPE); + QT_END_NAMESPACE #endif // QT_OSX_BLUETOOTH || QT_IOS_BLUETOOTH |