diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-07-20 16:20:03 +0400 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-01 08:34:03 +0200 |
commit | fc4ed403dc20507d3c3f137b4acb957e2eef3c41 (patch) | |
tree | 323acfba9252ab434ba8fba8956a15d8def37e90 /src/bluetooth/qbluetoothdevicediscoveryagent_p.h | |
parent | b2dcf3f5a2fb5a32eb6125024fb2070725fd87cc (diff) |
Implement the QBluetoothDeviceDiscoveryAgent class on Windows
Change-Id: I74eaf9acedbcd5b601ff3a6feef21869dbbf9bd9
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_p.h')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_p.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h index c4e804d3..c6199d62 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Denis Shienkov <denis.shienkov@gmail.com> ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtBluetooth module of the Qt Toolkit. @@ -71,6 +72,12 @@ QT_END_NAMESPACE #include <QTimer> #endif +#ifdef Q_OS_WIN32 +#include <QtConcurrent> +#include "qbluetoothlocaldevice_p.h" +#include <bluetoothapis.h> +#endif + QT_BEGIN_NAMESPACE class QBluetoothDeviceDiscoveryAgentPrivate @@ -78,6 +85,9 @@ class QBluetoothDeviceDiscoveryAgentPrivate : public QObject { Q_OBJECT +#elif defined(Q_OS_WIN32) + : public QBluetoothLocalDevicePrivateData +{ #else { #endif @@ -105,6 +115,10 @@ public: void _q_extendedDeviceDiscoveryTimeout(); #endif +#ifdef Q_OS_WIN32 + void _q_handleFindResult(); +#endif + private: QList<QBluetoothDeviceInfo> discoveredDevices; QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType; @@ -166,6 +180,20 @@ private: bool isFinished; #endif +#ifdef Q_OS_WIN32 + void processDiscoveredDevices(const BLUETOOTH_DEVICE_INFO &info); + void handleErrors(DWORD errorCode); + bool isRunning() const; + + static QVariant findFirstDevice(HANDLE radioHandle); + static QVariant findNextDevice(HBLUETOOTH_DEVICE_FIND findHandle); + static void findClose(HBLUETOOTH_DEVICE_FIND findHandle); + + QFutureWatcher<QVariant> *findWatcher; + bool pendingCancel; + bool pendingStart; +#endif + QBluetoothDeviceDiscoveryAgent *q_ptr; }; |