summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2017-11-29 15:15:51 +0100
committerAlex Blasche <alexander.blasche@qt.io>2018-01-05 09:06:48 +0000
commitda7a013dd2aa7bed9f4a6b5122b8f9dadcb252ab (patch)
tree6fa82dce354eec8871ab048caafddd85daa1cb49 /src/bluetooth/qlowenergycontroller_bluezdbus_p.h
parent37a3b8104588605f9055ea93e59112e48a114dc1 (diff)
BTLE DBus: Add ability to connect/disconnect to remote device
The patch uses the Device1 DBus API to connect and disconnect to a remote BTLE device. In addition, status and error condition tracking is added to adapt to various error cases. Task-number: QTBUG-46819 Change-Id: I0671df5596882c89aeead89c05ddcc855f8ba375 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_bluezdbus_p.h')
-rw-r--r--src/bluetooth/qlowenergycontroller_bluezdbus_p.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus_p.h b/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
index b10199f5..c4589381 100644
--- a/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
+++ b/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
@@ -55,6 +55,13 @@
#include "qlowenergycontroller.h"
#include "qlowenergycontrollerbase_p.h"
+#include <QtDBus/QDBusObjectPath>
+
+class OrgBluezAdapter1Interface;
+class OrgBluezDevice1Interface;
+class OrgFreedesktopDBusObjectManagerInterface;
+class OrgFreedesktopDBusPropertiesInterface;
+
QT_BEGIN_NAMESPACE
class QLowEnergyControllerPrivateBluezDBus : public QLowEnergyControllerPrivate
@@ -104,8 +111,25 @@ public:
QLowEnergyService *addServiceHelper(const QLowEnergyServiceData &service) override;
- QLowEnergyController::ControllerState state;
- QLowEnergyController::Error error;
+
+private:
+ void connectToDeviceHelper();
+ void resetController();
+
+private slots:
+ void devicePropertiesChanged(const QString &interface, const QVariantMap &changedProperties,
+ const QStringList &/*invalidatedProperties*/);
+ void interfacesRemoved(const QDBusObjectPath &objectPath, const QStringList &interfaces);
+
+private:
+ OrgBluezAdapter1Interface* adapter{};
+ OrgBluezDevice1Interface* device{};
+ OrgFreedesktopDBusObjectManagerInterface* managerBluez{};
+ OrgFreedesktopDBusPropertiesInterface* deviceMonitor{};
+
+ bool pendingConnect = false;
+ bool pendingDisconnect = false;
+ bool disconnectSignalRequired = false;
};
QT_END_NAMESPACE