summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/bluez/battery1_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/bluez/battery1_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/bluez/battery1_p.h')
-rw-r--r--src/bluetooth/bluez/battery1_p.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/bluetooth/bluez/battery1_p.h b/src/bluetooth/bluez/battery1_p.h
new file mode 100644
index 00000000..035382df
--- /dev/null
+++ b/src/bluetooth/bluez/battery1_p.h
@@ -0,0 +1,51 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -p battery1_p.h:battery1.cpp org.bluez.Battery1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2018 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#ifndef BATTERY1_P_H
+#define BATTERY1_P_H
+
+#include <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+
+/*
+ * Proxy class for interface org.bluez.Battery1
+ */
+class OrgBluezBattery1Interface: public QDBusAbstractInterface
+{
+ Q_OBJECT
+public:
+ static inline const char *staticInterfaceName()
+ { return "org.bluez.Battery1"; }
+
+public:
+ OrgBluezBattery1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
+
+ ~OrgBluezBattery1Interface();
+
+ Q_PROPERTY(uchar Percentage READ percentage)
+ inline uchar percentage() const
+ { return qvariant_cast< uchar >(property("Percentage")); }
+
+public Q_SLOTS: // METHODS
+Q_SIGNALS: // SIGNALS
+};
+
+namespace org {
+ namespace bluez {
+ typedef ::OrgBluezBattery1Interface Battery1;
+ }
+}
+#endif