summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_p.h')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.h46
1 files changed, 44 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
index a59c6a94..be3a8863 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2014 Denis Shienkov <denis.shienkov@gmail.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
@@ -83,7 +84,20 @@ class QDBusVariant;
QT_END_NAMESPACE
#endif
-#ifdef QT_WINRT_BLUETOOTH
+#ifdef QT_WIN_BLUETOOTH
+QT_BEGIN_NAMESPACE
+class QThread;
+
+class ThreadWorkerDeviceDiscovery : public QObject
+{
+ Q_OBJECT
+signals:
+ void discoveryCompleted(const QVariant res);
+};
+
+QT_END_NAMESPACE
+
+#elif defined(QT_WINRT_BLUETOOTH)
#include <QtCore/QPointer>
#include <QtCore/QTimer>
@@ -98,7 +112,8 @@ class QWinRTBluetoothDeviceDiscoveryWorker;
#endif
class QBluetoothDeviceDiscoveryAgentPrivate
-#if defined(QT_ANDROID_BLUETOOTH) || defined(QT_WINRT_BLUETOOTH) || defined(Q_OS_DARWIN)
+#if defined(QT_ANDROID_BLUETOOTH) || defined(QT_WINRT_BLUETOOTH) || defined(QT_WIN_BLUETOOTH) \
+ || defined(Q_OS_DARWIN)
: public QObject
#if defined(Q_OS_MACOS)
, public DarwinBluetooth::DeviceInquiryDelegate
@@ -175,6 +190,33 @@ private:
QTimer extendedDiscoveryTimer;
#endif
+#ifdef QT_WIN_BLUETOOTH
+public:
+ static QString discoveredLeDeviceSystemPath(const QBluetoothAddress &deviceAddress);
+
+private:
+ void cancelDiscovery();
+ void restartDiscovery();
+ void finishDiscovery(QBluetoothDeviceDiscoveryAgent::Error errorCode, const QString &errorText);
+
+ void startLeDevicesDiscovery();
+ void completeLeDevicesDiscovery(const QVariant &res);
+ void startClassicDevicesDiscovery(Qt::HANDLE hSearch = nullptr);
+ void completeClassicDevicesDiscovery(const QVariant &res);
+
+ void processDiscoveredDevice(const QBluetoothDeviceInfo &foundDevice);
+
+ QBluetoothAddress adapterAddress;
+ bool pendingCancel;
+ bool pendingStart;
+ bool active;
+
+ QThread *threadLE = nullptr;
+ QThread *threadClassic = nullptr;
+ ThreadWorkerDeviceDiscovery *threadWorkerLE = nullptr;
+ ThreadWorkerDeviceDiscovery *threadWorkerClassic = nullptr;
+#endif
+
#ifdef QT_WINRT_BLUETOOTH
private slots:
void registerDevice(const QBluetoothDeviceInfo &info);