summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice_p.h
diff options
context:
space:
mode:
authorOleksandr Matasov <ast.or.maar@gmail.com>2013-11-11 15:10:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-12 13:11:54 +0100
commitaf030bfbf86d807bed9511326699c82ccc9d9adb (patch)
treedbf5b0ca440540fe57eea0b571e460273537a53b /src/bluetooth/qbluetoothlocaldevice_p.h
parenta096dfe555762ed4cee747c99c274bd8d912fe66 (diff)
Added new API for device "connected" status
The feature allows to know whether QBluetoothLocalDevice is currently connected to any other device using connectedDevices() method. Change-Id: I4d1a19ebb0b42efd1fc5d5f0f9e7816aa956fbf4 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.h')
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h
index 0f2aaca8..7d5ed926 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.h
+++ b/src/bluetooth/qbluetoothlocaldevice_p.h
@@ -51,9 +51,11 @@
#include <QDBusContext>
#include <QDBusObjectPath>
#include <QDBusMessage>
+#include <QSet>
class OrgBluezAdapterInterface;
class OrgBluezAgentAdaptor;
+class OrgBluezDeviceInterface;
QT_BEGIN_NAMESPACE
class QDBusPendingCallWatcher;
@@ -78,8 +80,13 @@ public:
QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q, QBluetoothAddress localAddress = QBluetoothAddress());
~QBluetoothLocalDevicePrivate();
+ QSet<OrgBluezDeviceInterface *> devices;
+ QSet<QBluetoothAddress> connectedDevicesSet;
OrgBluezAdapterInterface *adapter;
OrgBluezAgentAdaptor *agent;
+
+ QList<QBluetoothAddress> connectedDevices() const;
+
QString agent_path;
QBluetoothAddress localAddress;
QBluetoothAddress address;
@@ -101,14 +108,22 @@ public Q_SLOTS: // METHODS
void pairingCompleted(QDBusPendingCallWatcher*);
void PropertyChanged(QString,QDBusVariant);
+ void _q_deviceCreated(const QDBusObjectPath &device);
+ void _q_deviceRemoved(const QDBusObjectPath &device);
+ void _q_devicePropertyChanged(const QString &property, const QDBusVariant &value);
bool isValid() const;
private:
+ void createCache();
+ void connectDeviceChanges();
+
QDBusMessage msgConfirmation;
QDBusConnection *msgConnection;
QBluetoothLocalDevice *q_ptr;
+ bool connectedCached;
+
void initializeAdapter();
};