diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2017-11-29 15:15:51 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-01-05 09:06:48 +0000 |
commit | da7a013dd2aa7bed9f4a6b5122b8f9dadcb252ab (patch) | |
tree | 6fa82dce354eec8871ab048caafddd85daa1cb49 /src/bluetooth/qlowenergycontroller_bluezdbus_p.h | |
parent | 37a3b8104588605f9055ea93e59112e48a114dc1 (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.h | 28 |
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 |