diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-06-13 13:06:01 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2017-06-19 14:11:27 +0000 |
commit | 6c4bd9551755dac834b107202df5d95b346f0b79 (patch) | |
tree | be34bcf5a8fc495887bf5bf21e2af14837538508 /src/bluetooth/qbluetoothdevicediscoveryagent_p.h | |
parent | 63ec6a9501b86946ca5c7b9c2176b764f55a82d9 (diff) |
Fix classic and LE devices discovery
Devices discovery was broken due to merging from 5.9 branch. Where were
introduced new QBluetoothDeviceDiscoveryAgent::DiscoveryMethods feature.
But now, this code is refactored and adjusted in completelly asynchronous
manner.
Change-Id: I9b7c4cbe27066ed05d1ed4546f71ea559544f6f5
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_p.h')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_p.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h index 4d0e24eb..9eadfae4 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h @@ -168,19 +168,25 @@ private: public: static QString discoveredLeDeviceSystemPath(const QBluetoothAddress &deviceAddress); -private slots: - void taskFinished(); - private: + void cancelDiscovery(); + void restartDiscovery(); + void finishDiscovery(QBluetoothDeviceDiscoveryAgent::Error errorCode, const QString &errorText); + + void startLeDevicesDiscovery(); + void completeLeDevicesDiscovery(); + void startClassicDevicesDiscovery(Qt::HANDLE hSearch = nullptr); + void completeClassicDevicesDiscovery(); + void processDiscoveredDevice(const QBluetoothDeviceInfo &foundDevice); QBluetoothAddress adapterAddress; bool pendingCancel; bool pendingStart; - QFutureWatcher<QBluetoothDeviceInfo> *scanWatcher; bool active; - int systemErrorCode; - Qt::HANDLE hSearch; + + QFutureWatcher<QVariant> *classicScanWatcher; + QFutureWatcher<QVariant> *lowenergyScanWatcher; #endif #ifdef QT_WINRT_BLUETOOTH |