summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice_p.h
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-07-17 18:34:13 +0400
committerDenis Shienkov <denis.shienkov@gmail.com>2014-07-23 09:25:22 +0200
commit7f1ed68c12c193561bd016da091d9ffff0b7724b (patch)
treedb2d649341d665772b6646eb4b4200b1a53d941c /src/bluetooth/qbluetoothlocaldevice_p.h
parent12881369cddf906a94bff8e5f2520d32369476a4 (diff)
Implement the initialization of QBluetoothLocalDevice
The instance of the local device is initialized via its bluetooth address. * If the constructor is passed an empty address, the class will be initialized using properties of first found local Bluetooth device in the system. * If the constructor is passed the specific address, it will enumerated all local Bluetooth devices and compares the Bluetooth address of each device. In case none of the addresses match, QBluetoothLocalDevice::isValid() returns false. Change-Id: Ib88df0403aa5d227ec6b75a4afcbf2f8675f05a8 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.h')
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h
index 55086012..383a1bb8 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.h
+++ b/src/bluetooth/qbluetoothlocaldevice_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.
@@ -78,6 +79,10 @@ QT_END_NAMESPACE
#include <QtCore/QPair>
#endif
+#ifdef Q_OS_WIN32
+#include <qt_windows.h>
+#endif
+
QT_BEGIN_NAMESPACE
class QBluetoothAddress;
@@ -234,6 +239,28 @@ private:
bool isValidDevice;
QList<QBluetoothAddress> connectedDevicesSet;
};
+
+#elif defined(Q_OS_WIN32)
+
+class QBluetoothLocalDevicePrivate : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PUBLIC(QBluetoothLocalDevice)
+public:
+ QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q, const QBluetoothAddress &address);
+ ~QBluetoothLocalDevicePrivate();
+
+ void initialize(const QBluetoothAddress &address);
+
+ bool isValid() const;
+
+private:
+ QBluetoothLocalDevice *q_ptr;
+ HANDLE deviceHandle;
+ QString deviceName;
+ QBluetoothAddress deviceAddress;
+};
+
#else
class QBluetoothLocalDevicePrivate : public QObject
{