diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-11-19 20:01:15 +0300 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-12-01 15:17:22 +0100 |
commit | 11095f3504515f0ec2a754f64f97719340247505 (patch) | |
tree | 74c64183fbb5cd6457bd956da574585c35b8ab9e /src/bluetooth/qbluetoothlocaldevice_p.h | |
parent | a3c295297a4ee1365619cc49f504a9f35b4f7785 (diff) |
Refactor of code for "classic" part on Windows
The previous code is based on the assumption where we can use each
of local radio separatelly to discovery of remote devices. Windows
API allows to use a handle of separately local bluetooth adapter to
operate with its power, to start/stop detection of remote devices
through it and so on. But in this API there is no opportunity to
enumerate services and attributes of the given remote device via
the concrete local adapter.
Therefore now to discovery of remote devices are used all local
bluetooth adapters in system. Also, the power and the host modes
management now are belongs to all local adapters at once.
Tested on Windows 8 with the USB CSR8510 A10 adapter
Change-Id: I949b112158a575f5b563a78163c1e3990c952ada
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.h')
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice_p.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h index c490ca85..3ed8ca62 100644 --- a/src/bluetooth/qbluetoothlocaldevice_p.h +++ b/src/bluetooth/qbluetoothlocaldevice_p.h @@ -83,7 +83,7 @@ QT_END_NAMESPACE #endif #ifdef Q_OS_WIN32 -#include <qt_windows.h> +#include "windows/qwinclassicbluetooth_p.h" #endif QT_BEGIN_NAMESPACE @@ -245,23 +245,21 @@ private: #elif defined(Q_OS_WIN32) -class QBluetoothLocalDevicePrivateData +class QBluetoothLocalDevicePrivate : public QObject { + Q_OBJECT + Q_DECLARE_PUBLIC(QBluetoothLocalDevice) public: - QBluetoothLocalDevicePrivateData(const QBluetoothAddress &address); + QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q, + const QBluetoothAddress &address = QBluetoothAddress()); + + ~QBluetoothLocalDevicePrivate(); bool isValid() const; + void initialize(const QBluetoothAddress &address); - HANDLE deviceHandle; - QString deviceName; QBluetoothAddress deviceAddress; -}; - -class QBluetoothLocalDevicePrivate : public QBluetoothLocalDevicePrivateData -{ - Q_DECLARE_PUBLIC(QBluetoothLocalDevice) -public: - QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q, const QBluetoothAddress &address); - ~QBluetoothLocalDevicePrivate(); + QString deviceName; + bool deviceValid; private: QBluetoothLocalDevice *q_ptr; |