diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2016-10-31 15:32:54 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2016-11-01 12:06:02 +0000 |
commit | b825e8e5703c12902112fd96285a81c6f2824f96 (patch) | |
tree | ba0b2fe4e46e004798d3bb939100d8ecd530bbda /src/bluetooth/qlowenergycontroller_p.h | |
parent | d6e28d96927cec11df8bae6d8f150fb985984bbf (diff) |
winrt: BTLE: Handle characteristic changes
Task-number: QTBUG-37779
Change-Id: Ie368e85286a3d132c633ef759a2bdb0fb206172d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_p.h')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_p.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/bluetooth/qlowenergycontroller_p.h b/src/bluetooth/qlowenergycontroller_p.h index 38e38752..f6bf0ae3 100644 --- a/src/bluetooth/qlowenergycontroller_p.h +++ b/src/bluetooth/qlowenergycontroller_p.h @@ -84,20 +84,7 @@ QT_END_NAMESPACE #include "android/lowenergynotificationhub_p.h" #elif defined(QT_WINRT_BLUETOOTH) #include <wrl.h> - -namespace ABI { - namespace Windows { - namespace Devices { - namespace Bluetooth { - struct IBluetoothLEDevice; - namespace GenericAttributeProfile { - struct IGattDeviceService; - struct IGattCharacteristic; - } - } - } - } -} +#include <windows.devices.bluetooth.h> class QWinRTLowEnergyServiceHandler; #endif @@ -433,13 +420,31 @@ private slots: void characteristicChanged(int charHandle, const QByteArray &data); void serviceError(int attributeHandle, QLowEnergyService::ServiceError errorCode); #elif defined(QT_WINRT_BLUETOOTH) +private slots: + void characteristicChanged(int charHandle, const QByteArray &data); + private: Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::IBluetoothLEDevice> mDevice; EventRegistrationToken mStatusChangedToken; + struct ValueChangedEntry { + ValueChangedEntry() {} + ValueChangedEntry(Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattCharacteristic> c, + EventRegistrationToken t) + : characteristic(c) + , token(t) + { + } + + Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattCharacteristic> characteristic; + EventRegistrationToken token; + }; + QVector<ValueChangedEntry> mValueChangedTokens; Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattDeviceService> getNativeService(const QBluetoothUuid &serviceUuid); Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattCharacteristic> getNativeCharacteristic(const QBluetoothUuid &serviceUuid, const QBluetoothUuid &charUuid); + void registerForValueChanges(const QBluetoothUuid &serviceUuid, const QBluetoothUuid &charUuid); + void obtainIncludedServices(QSharedPointer<QLowEnergyServicePrivate> servicePointer, Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattDeviceService> nativeService); #endif |