summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2018-08-31 14:56:58 +0200
committerAlex Blasche <alexander.blasche@qt.io>2018-09-14 12:15:04 +0000
commitba0988639b7951798002be10d6868718d56141f6 (patch)
tree7d4ac2c429d9b1291fdeefad7cf53ef07eb1f585 /src/bluetooth/qlowenergycontroller_bluezdbus_p.h
parentaf07a801cb85094d2ab4a45244d5172e64f8ff7b (diff)
Implement handling of BTLE Battery services
Since BlueZ 5.48 battery services are no longer exposed via the generic GATT interface but have their own dedicated Battery1 interface. This patch transforms the dedicated interface back into the previous behavior. Essentially we are emulating the old interface to ensure that the QLowEnergyService user does not have to distinguish. Fixes: QTBUG-70222 Change-Id: Ib9fef41cf16f7562f169f51ee45b19f52de6a0c0 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus_p.h b/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
index 4c0f5b74..4c169d0b 100644
--- a/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
+++ b/src/bluetooth/qlowenergycontroller_bluezdbus_p.h
@@ -58,6 +58,7 @@
#include <QtDBus/QDBusObjectPath>
class OrgBluezAdapter1Interface;
+class OrgBluezBattery1Interface;
class OrgBluezDevice1Interface;
class OrgBluezGattCharacteristic1Interface;
class OrgBluezGattDescriptor1Interface;
@@ -155,6 +156,9 @@ private:
{
QString servicePath;
QVector<GattCharacteristic> characteristics;
+
+ bool hasBatteryService = false;
+ QSharedPointer<OrgBluezBattery1Interface> batteryInterface;
};
QHash<QBluetoothUuid, GattService> dbusServices;
@@ -183,6 +187,8 @@ private:
bool jobPending = false;
void prepareNextJob();
+ void discoverBatteryServiceDetails(GattService &dbusData,
+ QSharedPointer<QLowEnergyServicePrivate> serviceData);
};
QT_END_NAMESPACE