summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/bluez
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/bluez')
-rw-r--r--src/bluetooth/bluez/adapter.cpp26
-rw-r--r--src/bluetooth/bluez/adapter1_bluez5.cpp6
-rw-r--r--src/bluetooth/bluez/adapter1_bluez5_p.h18
-rw-r--r--src/bluetooth/bluez/adapter_p.h157
-rw-r--r--src/bluetooth/bluez/agent.cpp87
-rw-r--r--src/bluetooth/bluez/agent_p.h79
-rw-r--r--src/bluetooth/bluez/battery1.cpp6
-rw-r--r--src/bluetooth/bluez/battery1_p.h18
-rw-r--r--src/bluetooth/bluez/bluetoothmanagement.cpp70
-rw-r--r--src/bluetooth/bluez/bluetoothmanagement_p.h93
-rw-r--r--src/bluetooth/bluez/bluez.pri58
-rw-r--r--src/bluetooth/bluez/bluez5_helper.cpp141
-rw-r--r--src/bluetooth/bluez/bluez5_helper_p.h57
-rw-r--r--src/bluetooth/bluez/bluez_data.cpp10
-rw-r--r--src/bluetooth/bluez/bluez_data_p.h184
-rw-r--r--src/bluetooth/bluez/bluezperipheralapplication.cpp280
-rw-r--r--src/bluetooth/bluez/bluezperipheralapplication_p.h100
-rw-r--r--src/bluetooth/bluez/bluezperipheralconnectionmanager.cpp96
-rw-r--r--src/bluetooth/bluez/bluezperipheralconnectionmanager_p.h68
-rw-r--r--src/bluetooth/bluez/bluezperipheralobjects.cpp403
-rw-r--r--src/bluetooth/bluez/bluezperipheralobjects_p.h171
-rw-r--r--src/bluetooth/bluez/device.cpp26
-rw-r--r--src/bluetooth/bluez/device1_bluez5.cpp6
-rw-r--r--src/bluetooth/bluez/device1_bluez5_p.h24
-rw-r--r--src/bluetooth/bluez/device_p.h104
-rw-r--r--src/bluetooth/bluez/gattchar1.cpp6
-rw-r--r--src/bluetooth/bluez/gattchar1_p.h18
-rw-r--r--src/bluetooth/bluez/gattcharacteristic1adaptor.cpp108
-rw-r--r--src/bluetooth/bluez/gattcharacteristic1adaptor_p.h87
-rw-r--r--src/bluetooth/bluez/gattdesc1.cpp6
-rw-r--r--src/bluetooth/bluez/gattdesc1_p.h18
-rw-r--r--src/bluetooth/bluez/gattdescriptor1adaptor.cpp84
-rw-r--r--src/bluetooth/bluez/gattdescriptor1adaptor_p.h75
-rw-r--r--src/bluetooth/bluez/gattmanager1.cpp28
-rw-r--r--src/bluetooth/bluez/gattmanager1_p.h73
-rw-r--r--src/bluetooth/bluez/gattservice1.cpp6
-rw-r--r--src/bluetooth/bluez/gattservice1_p.h18
-rw-r--r--src/bluetooth/bluez/gattservice1adaptor.cpp58
-rw-r--r--src/bluetooth/bluez/gattservice1adaptor_p.h67
-rwxr-xr-xsrc/bluetooth/bluez/generate49
-rw-r--r--src/bluetooth/bluez/hcimanager.cpp99
-rw-r--r--src/bluetooth/bluez/hcimanager_p.h180
-rw-r--r--src/bluetooth/bluez/leadvertisement1.cpp136
-rw-r--r--src/bluetooth/bluez/leadvertisement1_p.h97
-rw-r--r--src/bluetooth/bluez/leadvertisingmanager1.cpp28
-rw-r--r--src/bluetooth/bluez/leadvertisingmanager1_p.h85
-rw-r--r--src/bluetooth/bluez/manager.cpp26
-rw-r--r--src/bluetooth/bluez/manager_p.h69
-rw-r--r--src/bluetooth/bluez/obex_agent.cpp67
-rw-r--r--src/bluetooth/bluez/obex_agent_p.h66
-rw-r--r--src/bluetooth/bluez/obex_client.cpp26
-rw-r--r--src/bluetooth/bluez/obex_client1_bluez5.cpp26
-rw-r--r--src/bluetooth/bluez/obex_client1_bluez5_p.h63
-rw-r--r--src/bluetooth/bluez/obex_client_p.h82
-rw-r--r--src/bluetooth/bluez/obex_manager.cpp26
-rw-r--r--src/bluetooth/bluez/obex_manager_p.h65
-rw-r--r--src/bluetooth/bluez/obex_objectpush1_bluez5.cpp26
-rw-r--r--src/bluetooth/bluez/obex_objectpush1_bluez5_p.h100
-rw-r--r--src/bluetooth/bluez/obex_transfer.cpp26
-rw-r--r--src/bluetooth/bluez/obex_transfer1_bluez5.cpp26
-rw-r--r--src/bluetooth/bluez/obex_transfer1_bluez5_p.h91
-rw-r--r--src/bluetooth/bluez/obex_transfer_p.h59
-rw-r--r--src/bluetooth/bluez/objectmanager.cpp6
-rw-r--r--src/bluetooth/bluez/objectmanager_p.h19
-rw-r--r--src/bluetooth/bluez/objectmanageradaptor.cpp42
-rw-r--r--src/bluetooth/bluez/objectmanageradaptor_p.h67
-rw-r--r--src/bluetooth/bluez/org.bluez.Agent.xml32
-rw-r--r--src/bluetooth/bluez/org.bluez.Client1.xml15
-rw-r--r--src/bluetooth/bluez/org.bluez.Device.xml41
-rw-r--r--src/bluetooth/bluez/org.bluez.Device1.xml4
-rw-r--r--src/bluetooth/bluez/org.bluez.GattManager1.xml14
-rw-r--r--src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml29
-rw-r--r--src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml20
-rw-r--r--src/bluetooth/bluez/org.bluez.Manager.xml25
-rw-r--r--src/bluetooth/bluez/org.bluez.Service.xml21
-rw-r--r--src/bluetooth/bluez/org.bluez.all.xml145
-rw-r--r--src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml25
-rw-r--r--src/bluetooth/bluez/org.bluez.obex.Transfer1.xml16
-rw-r--r--src/bluetooth/bluez/org.openobex.agent.xml24
-rw-r--r--src/bluetooth/bluez/org.openobex.all.xml31
-rw-r--r--src/bluetooth/bluez/org.openobex.client.xml40
-rw-r--r--src/bluetooth/bluez/org.openobex.transfer.xml19
-rw-r--r--src/bluetooth/bluez/profile1.cpp6
-rw-r--r--src/bluetooth/bluez/profile1_p.h18
-rw-r--r--src/bluetooth/bluez/profile1context.cpp42
-rw-r--r--src/bluetooth/bluez/profile1context_p.h41
-rw-r--r--src/bluetooth/bluez/profilemanager1.cpp6
-rw-r--r--src/bluetooth/bluez/profilemanager1_p.h18
-rw-r--r--src/bluetooth/bluez/properties.cpp6
-rw-r--r--src/bluetooth/bluez/properties_p.h21
-rw-r--r--src/bluetooth/bluez/propertiesadaptor.cpp56
-rw-r--r--src/bluetooth/bluez/propertiesadaptor_p.h76
-rw-r--r--src/bluetooth/bluez/remotedevicemanager.cpp52
-rw-r--r--src/bluetooth/bluez/remotedevicemanager_p.h45
-rw-r--r--src/bluetooth/bluez/service.cpp26
-rw-r--r--src/bluetooth/bluez/service_p.h81
-rw-r--r--src/bluetooth/bluez/servicemap.cpp46
-rw-r--r--src/bluetooth/bluez/servicemap_p.h49
98 files changed, 3023 insertions, 2659 deletions
diff --git a/src/bluetooth/bluez/adapter.cpp b/src/bluetooth/bluez/adapter.cpp
deleted file mode 100644
index eaea76f8..00000000
--- a/src/bluetooth/bluez/adapter.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p adapter_p.h:adapter.cpp org.bluez.all.xml org.bluez.Adapter
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "adapter_p.h"
-
-/*
- * Implementation of interface class OrgBluezAdapterInterface
- */
-
-OrgBluezAdapterInterface::OrgBluezAdapterInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezAdapterInterface::~OrgBluezAdapterInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/adapter1_bluez5.cpp b/src/bluetooth/bluez/adapter1_bluez5.cpp
index b1aefc8d..285c79b1 100644
--- a/src/bluetooth/bluez/adapter1_bluez5.cpp
+++ b/src/bluetooth/bluez/adapter1_bluez5.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p adapter1_bluez5_p.h:adapter1_bluez5.cpp org.bluez.Adapter1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p adapter1_bluez5_p.h:adapter1_bluez5.cpp org.bluez.Adapter1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezAdapter1Interface::~OrgBluezAdapter1Interface()
{
}
+
+#include "moc_adapter1_bluez5_p.cpp"
diff --git a/src/bluetooth/bluez/adapter1_bluez5_p.h b/src/bluetooth/bluez/adapter1_bluez5_p.h
index ce108ad0..fc641b37 100644
--- a/src/bluetooth/bluez/adapter1_bluez5_p.h
+++ b/src/bluetooth/bluez/adapter1_bluez5_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p adapter1_bluez5_p.h:adapter1_bluez5.cpp org.bluez.Adapter1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p adapter1_bluez5_p.h:adapter1_bluez5.cpp org.bluez.Adapter1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef ADAPTER1_BLUEZ5_P_H
#define ADAPTER1_BLUEZ5_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.Adapter1
@@ -127,7 +139,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezAdapter1Interface Adapter1;
+ using Adapter1 = ::OrgBluezAdapter1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/adapter_p.h b/src/bluetooth/bluez/adapter_p.h
deleted file mode 100644
index 236fe7e4..00000000
--- a/src/bluetooth/bluez/adapter_p.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p adapter_p.h:adapter.cpp org.bluez.all.xml org.bluez.Adapter
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef ADAPTER_P_H
-#define ADAPTER_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.Adapter
- */
-class OrgBluezAdapterInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.Adapter"; }
-
-public:
- OrgBluezAdapterInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezAdapterInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> CancelDeviceCreation(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("CancelDeviceCreation"), argumentList);
- }
-
- inline QDBusPendingReply<QDBusObjectPath> CreateDevice(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("CreateDevice"), argumentList);
- }
-
- inline QDBusPendingReply<QDBusObjectPath> CreatePairedDevice(const QString &in0, const QDBusObjectPath &in1, const QString &in2)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
- return asyncCallWithArgumentList(QStringLiteral("CreatePairedDevice"), argumentList);
- }
-
- inline QDBusPendingReply<QDBusObjectPath> FindDevice(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("FindDevice"), argumentList);
- }
-
- inline QDBusPendingReply<QVariantMap> GetProperties()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetProperties"), argumentList);
- }
-
- inline QDBusPendingReply<QList<QDBusObjectPath> > ListDevices()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("ListDevices"), argumentList);
- }
-
- inline QDBusPendingReply<> RegisterAgent(const QDBusObjectPath &in0, const QString &in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("RegisterAgent"), argumentList);
- }
-
- inline QDBusPendingReply<> ReleaseMode()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("ReleaseMode"), argumentList);
- }
-
- inline QDBusPendingReply<> ReleaseSession()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("ReleaseSession"), argumentList);
- }
-
- inline QDBusPendingReply<> RemoveDevice(const QDBusObjectPath &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("RemoveDevice"), argumentList);
- }
-
- inline QDBusPendingReply<> RequestMode(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("RequestMode"), argumentList);
- }
-
- inline QDBusPendingReply<> RequestSession()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("RequestSession"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProperty(const QString &in0, const QDBusVariant &in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("SetProperty"), argumentList);
- }
-
- inline QDBusPendingReply<> StartDiscovery()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("StartDiscovery"), argumentList);
- }
-
- inline QDBusPendingReply<> StopDiscovery()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("StopDiscovery"), argumentList);
- }
-
- inline QDBusPendingReply<> UnregisterAgent(const QDBusObjectPath &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("UnregisterAgent"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void DeviceCreated(const QDBusObjectPath &in0);
- void DeviceDisappeared(const QString &in0);
- void DeviceFound(const QString &in0, const QVariantMap &in1);
- void DeviceRemoved(const QDBusObjectPath &in0);
- void PropertyChanged(const QString &in0, const QDBusVariant &in1);
-};
-
-namespace org {
- namespace bluez {
- typedef ::OrgBluezAdapterInterface Adapter;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/agent.cpp b/src/bluetooth/bluez/agent.cpp
deleted file mode 100644
index 6fa80176..00000000
--- a/src/bluetooth/bluez/agent.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -c OrgBluezAgentAdaptor -a agent_p.h:agent.cpp org.bluez.Agent.xml org.bluez.Agent
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "agent_p.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class OrgBluezAgentAdaptor
- */
-
-OrgBluezAgentAdaptor::OrgBluezAgentAdaptor(QObject *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-OrgBluezAgentAdaptor::~OrgBluezAgentAdaptor()
-{
- // destructor
-}
-
-void OrgBluezAgentAdaptor::Authorize(const QDBusObjectPath &in0, const QString &in1)
-{
- // handle method call org.bluez.Agent.Authorize
- QMetaObject::invokeMethod(parent(), "Authorize", Q_ARG(QDBusObjectPath, in0), Q_ARG(QString, in1));
-}
-
-void OrgBluezAgentAdaptor::Cancel()
-{
- // handle method call org.bluez.Agent.Cancel
- QMetaObject::invokeMethod(parent(), "Cancel");
-}
-
-void OrgBluezAgentAdaptor::ConfirmModeChange(const QString &in0)
-{
- // handle method call org.bluez.Agent.ConfirmModeChange
- QMetaObject::invokeMethod(parent(), "ConfirmModeChange", Q_ARG(QString, in0));
-}
-
-void OrgBluezAgentAdaptor::DisplayPasskey(const QDBusObjectPath &in0, uint in1, uchar in2)
-{
- // handle method call org.bluez.Agent.DisplayPasskey
- QMetaObject::invokeMethod(parent(), "DisplayPasskey", Q_ARG(QDBusObjectPath, in0), Q_ARG(uint, in1), Q_ARG(uchar, in2));
-}
-
-void OrgBluezAgentAdaptor::Release()
-{
- // handle method call org.bluez.Agent.Release
- QMetaObject::invokeMethod(parent(), "Release");
-}
-
-void OrgBluezAgentAdaptor::RequestConfirmation(const QDBusObjectPath &in0, uint in1)
-{
- // handle method call org.bluez.Agent.RequestConfirmation
- QMetaObject::invokeMethod(parent(), "RequestConfirmation", Q_ARG(QDBusObjectPath, in0), Q_ARG(uint, in1));
-}
-
-uint OrgBluezAgentAdaptor::RequestPasskey(const QDBusObjectPath &in0)
-{
- // handle method call org.bluez.Agent.RequestPasskey
- uint out0;
- QMetaObject::invokeMethod(parent(), "RequestPasskey", Q_RETURN_ARG(uint, out0), Q_ARG(QDBusObjectPath, in0));
- return out0;
-}
-
-QString OrgBluezAgentAdaptor::RequestPinCode(const QDBusObjectPath &in0)
-{
- // handle method call org.bluez.Agent.RequestPinCode
- QString out0;
- QMetaObject::invokeMethod(parent(), "RequestPinCode", Q_RETURN_ARG(QString, out0), Q_ARG(QDBusObjectPath, in0));
- return out0;
-}
-
diff --git a/src/bluetooth/bluez/agent_p.h b/src/bluetooth/bluez/agent_p.h
deleted file mode 100644
index 7ca177fd..00000000
--- a/src/bluetooth/bluez/agent_p.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -c OrgBluezAgentAdaptor -a agent_p.h:agent.cpp org.bluez.Agent.xml org.bluez.Agent
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef AGENT_P_H
-#define AGENT_P_H
-
-#include <QtCore/QObject>
-#include <QtCore/qcontainerfwd.h>
-#include <QtDBus/QtDBus>
-QT_BEGIN_NAMESPACE
-class QByteArray;
-class QString;
-class QStringList;
-class QVariant;
-QT_END_NAMESPACE
-
-/*
- * Adaptor class for interface org.bluez.Agent
- */
-class OrgBluezAgentAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.bluez.Agent")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.bluez.Agent\">\n"
-" <method name=\"Release\"/>\n"
-" <method name=\"RequestPinCode\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"out\" type=\"s\"/>\n"
-" </method>\n"
-" <method name=\"RequestPasskey\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"out\" type=\"u\"/>\n"
-" </method>\n"
-" <method name=\"DisplayPasskey\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"in\" type=\"u\"/>\n"
-" <arg direction=\"in\" type=\"y\"/>\n"
-" </method>\n"
-" <method name=\"RequestConfirmation\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"in\" type=\"u\"/>\n"
-" </method>\n"
-" <method name=\"Authorize\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"in\" type=\"s\"/>\n"
-" </method>\n"
-" <method name=\"ConfirmModeChange\">\n"
-" <arg direction=\"in\" type=\"s\"/>\n"
-" </method>\n"
-" <method name=\"Cancel\"/>\n"
-" </interface>\n"
- "")
-public:
- OrgBluezAgentAdaptor(QObject *parent);
- virtual ~OrgBluezAgentAdaptor();
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- void Authorize(const QDBusObjectPath &in0, const QString &in1);
- void Cancel();
- void ConfirmModeChange(const QString &in0);
- void DisplayPasskey(const QDBusObjectPath &in0, uint in1, uchar in2);
- void Release();
- void RequestConfirmation(const QDBusObjectPath &in0, uint in1);
- uint RequestPasskey(const QDBusObjectPath &in0);
- QString RequestPinCode(const QDBusObjectPath &in0);
-Q_SIGNALS: // SIGNALS
-};
-
-#endif
diff --git a/src/bluetooth/bluez/battery1.cpp b/src/bluetooth/bluez/battery1.cpp
index f23cc205..abbad849 100644
--- a/src/bluetooth/bluez/battery1.cpp
+++ b/src/bluetooth/bluez/battery1.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p battery1_p.h:battery1.cpp org.bluez.Battery1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p battery1_p.h:battery1.cpp org.bluez.Battery1.xml
*
- * qdbusxml2cpp is Copyright (C) 2018 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezBattery1Interface::~OrgBluezBattery1Interface()
{
}
+
+#include "moc_battery1_p.cpp"
diff --git a/src/bluetooth/bluez/battery1_p.h b/src/bluetooth/bluez/battery1_p.h
index 035382df..8211209d 100644
--- a/src/bluetooth/bluez/battery1_p.h
+++ b/src/bluetooth/bluez/battery1_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p battery1_p.h:battery1.cpp org.bluez.Battery1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p battery1_p.h:battery1.cpp org.bluez.Battery1.xml
*
- * qdbusxml2cpp is Copyright (C) 2018 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef BATTERY1_P_H
#define BATTERY1_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.Battery1
@@ -45,7 +57,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezBattery1Interface Battery1;
+ using Battery1 = ::OrgBluezBattery1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/bluetoothmanagement.cpp b/src/bluetooth/bluez/bluetoothmanagement.cpp
index 6a1e8864..15ca8e56 100644
--- a/src/bluetooth/bluez/bluetoothmanagement.cpp
+++ b/src/bluetooth/bluez/bluetoothmanagement.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/qloggingcategory.h>
#include <QtCore/qsocketnotifier.h>
@@ -51,15 +15,12 @@
#include <sys/types.h>
#include <linux/capability.h>
+#include <cerrno>
QT_BEGIN_NAMESPACE
// Packet data structures for Mgmt API bluez.git/doc/mgmt-api.txt
-enum class EventCode {
- DeviceFound = 0x0012,
-};
-
struct MgmtHdr {
quint16 cmdCode;
quint16 controllerIndex;
@@ -125,11 +86,6 @@ struct capData {
const int msecInADay = 1000*60*60*24;
-inline uint qHash(const QBluetoothAddress& address)
-{
- return qHash(address.toUInt64());
-}
-
static int sysCallCapGet(capHdr *header, capData *data)
{
return syscall(__NR_capget, header, data);
@@ -209,7 +165,7 @@ BluetoothManagement *BluetoothManagement::instance()
void BluetoothManagement::_q_readNotifier()
{
char *dst = buffer.reserve(QPRIVATELINEARBUFFER_BUFFERSIZE);
- int readCount = ::read(fd, dst, QPRIVATELINEARBUFFER_BUFFERSIZE);
+ const auto readCount = ::read(fd, dst, QPRIVATELINEARBUFFER_BUFFERSIZE);
buffer.chop(QPRIVATELINEARBUFFER_BUFFERSIZE - (readCount < 0 ? 0 : readCount));
if (readCount < 0) {
qCWarning(QT_BT_BLUEZ, "Management Control read error %s", qPrintable(qt_error_string(errno)));
@@ -217,24 +173,24 @@ void BluetoothManagement::_q_readNotifier()
}
// do we have at least one complete mgmt header?
- if ((uint)buffer.size() < sizeof(MgmtHdr))
+ if (size_t(buffer.size()) < sizeof(MgmtHdr))
return;
QByteArray data = buffer.readAll();
while (true) {
- if ((uint)data.size() < sizeof(MgmtHdr))
+ if (size_t(data.size()) < sizeof(MgmtHdr))
break;
const MgmtHdr *hdr = reinterpret_cast<const MgmtHdr*>(data.constData());
- const int nextPackageSize = qFromLittleEndian(hdr->length) + sizeof(MgmtHdr);
- const int remainingPackageSize = data.length() - nextPackageSize;
+ const auto nextPackageSize = qsizetype(qFromLittleEndian(hdr->length) + sizeof(MgmtHdr));
+ const qsizetype remainingPackageSize = data.size() - nextPackageSize;
- if (data.length() < nextPackageSize)
+ if (data.size() < nextPackageSize)
break; // not a complete event header -> wait for next notifier
switch (static_cast<EventCode>(qFromLittleEndian(hdr->cmdCode))) {
- case EventCode::DeviceFound:
+ case EventCode::DeviceFoundEvent:
{
const MgmtEventDeviceFound *event = reinterpret_cast<const MgmtEventDeviceFound*>
(data.constData() + sizeof(MgmtHdr));
@@ -254,11 +210,11 @@ void BluetoothManagement::_q_readNotifier()
}
default:
qCDebug(QT_BT_BLUEZ) << "BluetoothManagement: Ignored event:"
- << Qt::hex << qFromLittleEndian(hdr->cmdCode);
+ << Qt::hex << (EventCode)qFromLittleEndian(hdr->cmdCode);
break;
}
- if (data.length() > nextPackageSize)
+ if (data.size() > nextPackageSize)
data = data.right(remainingPackageSize);
else
data.clear();
@@ -312,3 +268,5 @@ bool BluetoothManagement::isMonitoringEnabled() const
QT_END_NAMESPACE
+
+#include "moc_bluetoothmanagement_p.cpp"
diff --git a/src/bluetooth/bluez/bluetoothmanagement_p.h b/src/bluetooth/bluez/bluetoothmanagement_p.h
index 954f6e03..c45d31f7 100644
--- a/src/bluetooth/bluez/bluetoothmanagement_p.h
+++ b/src/bluetooth/bluez/bluetoothmanagement_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BLUETOOTHMANAGEMENT_P_H
#define BLUETOOTHMANAGEMENT_P_H
@@ -58,7 +22,7 @@
#include <QtBluetooth/qbluetoothaddress.h>
#ifndef QPRIVATELINEARBUFFER_BUFFERSIZE
-#define QPRIVATELINEARBUFFER_BUFFERSIZE Q_INT64_C(16384)
+#define QPRIVATELINEARBUFFER_BUFFERSIZE qsizetype(16384)
#endif
#include "../qprivatelinearbuffer_p.h"
@@ -71,6 +35,57 @@ class BluetoothManagement : public QObject
Q_OBJECT
public:
+
+ enum class EventCode {
+ CommandCompleteEvent = 0x0001,
+ CommandStatusEvent = 0x0002,
+ ControllerErrorEvent = 0x0003,
+ IndexAddedEvent = 0x0004,
+ IndexRemovedEvent = 0x0005,
+ NewSettingsEvent = 0x0006,
+ ClassOfDeviceChangedEvent = 0x0007,
+ LocalNameChangedEvent = 0x0008,
+ NewLinkKeyEvent = 0x0009,
+ NewLongTermKeyEvent = 0x000A,
+ DeviceConnectedEvent = 0x000B,
+ DeviceDisconnectedEvent = 0x000C,
+ ConnectFailedEvent = 0x000D,
+ PINCodeRequestEvent = 0x000E,
+ UserConfirmationRequestEvent = 0x000F,
+ UserPasskeyRequestEvent = 0x0010,
+ AuthenticationFailedEvent = 0x0011,
+ DeviceFoundEvent = 0x0012,
+ DiscoveringEvent = 0x0013,
+ DeviceBlockedEvent = 0x0014,
+ DeviceUnblockedEvent = 0x00150,
+ DeviceUnpairedEvent = 0x0016,
+ PasskeyNotifyEvent = 0x0017,
+ NewIdentityResolvingKeyEvent = 0x0018,
+ NewSignatureResolvingKeyEvent = 0x0019,
+ DeviceAddedEvent = 0x001a,
+ DeviceRemovedEvent = 0x001b,
+ NewConnectionParameterEvent = 0x001c,
+ UnconfiguredIndexAddedEvent = 0x001d,
+ UnconfiguredIndexRemovedEvent = 0x001e,
+ NewConfigurationOptionsEvent = 0x001f,
+ ExtendedIndexAddedEvent = 0x0020,
+ ExtendedIndexRemovedEvent = 0x0021,
+ LocalOutOfBandExtendedDataUpdatedEvent = 0x0022,
+ AdvertisingAddedEvent = 0x0023,
+ AdvertisingRemovedEvent = 0x0024,
+ ExtendedControllerInformationChangedEvent = 0x0025,
+ PHYConfigurationChangedEvent = 0x0026,
+ ExperimentalFeatureChangedEvent = 0x0027,
+ DefaultSystemConfigurationChangedEvent = 0x0028,
+ DefaultRuntimeConfigurationChangedEvent = 0x0029,
+ DeviceFlagsChangedEvent = 0x002a,
+ AdvertisementMonitorAddedEvent = 0x002b,
+ AdvertisementMonitorRemovedEvent = 0x002c,
+ ControllerSuspendEvent = 0x002d,
+ ControllerResumeEvent = 0x002e
+ };
+ Q_ENUM(EventCode)
+
explicit BluetoothManagement(QObject *parent = nullptr);
static BluetoothManagement *instance();
diff --git a/src/bluetooth/bluez/bluez.pri b/src/bluetooth/bluez/bluez.pri
deleted file mode 100644
index af7f0e0c..00000000
--- a/src/bluetooth/bluez/bluez.pri
+++ /dev/null
@@ -1,58 +0,0 @@
-HEADERS += bluez/manager_p.h \
- bluez/adapter_p.h \
- bluez/device_p.h \
- bluez/service_p.h \
- bluez/agent_p.h \
- bluez/servicemap_p.h \
- bluez/obex_client_p.h \
- bluez/obex_agent_p.h \
- bluez/obex_transfer_p.h \
- bluez/obex_manager_p.h \
- bluez/bluez5_helper_p.h \
- bluez/objectmanager_p.h \
- bluez/properties_p.h \
- bluez/adapter1_bluez5_p.h \
- bluez/device1_bluez5_p.h \
- bluez/profilemanager1_p.h \
- bluez/profile1_p.h \
- bluez/profile1context_p.h \
- bluez/obex_client1_bluez5_p.h \
- bluez/obex_objectpush1_bluez5_p.h \
- bluez/obex_transfer1_bluez5_p.h \
- bluez/gattchar1_p.h \
- bluez/gattdesc1_p.h \
- bluez/gattservice1_p.h \
- bluez/battery1_p.h \
- bluez/bluez_data_p.h \
- bluez/hcimanager_p.h \
- bluez/remotedevicemanager_p.h \
- bluez/bluetoothmanagement_p.h
-
-SOURCES += bluez/manager.cpp \
- bluez/adapter.cpp \
- bluez/agent.cpp \
- bluez/device.cpp \
- bluez/service.cpp \
- bluez/servicemap.cpp \
- bluez/obex_client.cpp \
- bluez/obex_agent.cpp \
- bluez/obex_transfer.cpp \
- bluez/obex_manager.cpp \
- bluez/objectmanager.cpp \
- bluez/properties.cpp \
- bluez/adapter1_bluez5.cpp \
- bluez/device1_bluez5.cpp \
- bluez/bluez5_helper.cpp \
- bluez/profilemanager1.cpp \
- bluez/profile1.cpp \
- bluez/profile1context.cpp \
- bluez/obex_client1_bluez5.cpp \
- bluez/obex_objectpush1_bluez5.cpp \
- bluez/obex_transfer1_bluez5.cpp \
- bluez/gattchar1.cpp \
- bluez/gattdesc1.cpp \
- bluez/gattservice1.cpp \
- bluez/battery1.cpp \
- bluez/hcimanager.cpp \
- bluez/remotedevicemanager.cpp \
- bluez/bluetoothmanagement.cpp
diff --git a/src/bluetooth/bluez/bluez5_helper.cpp b/src/bluetooth/bluez/bluez5_helper.cpp
index 7ce67690..3b74ee64 100644
--- a/src/bluetooth/bluez/bluez5_helper.cpp
+++ b/src/bluetooth/bluez/bluez5_helper.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/QGlobalStatic>
#include <QtCore/QLoggingCategory>
@@ -47,58 +11,54 @@
#include "objectmanager_p.h"
#include "properties_p.h"
#include "adapter1_bluez5_p.h"
-#include "manager_p.h"
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(InterfaceList)
+QT_IMPL_METATYPE_EXTERN(ManufacturerDataList)
+QT_IMPL_METATYPE_EXTERN(ServiceDataList)
+QT_IMPL_METATYPE_EXTERN(ManagedObjectList)
+
+
Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ)
typedef enum Bluez5TestResultType
{
BluezVersionUnknown,
- BluezVersion4,
BluezVersion5,
BluezNotAvailable
} Bluez5TestResult;
-Q_GLOBAL_STATIC_WITH_ARGS(Bluez5TestResult, bluezVersion, (BluezVersionUnknown));
-Q_GLOBAL_STATIC_WITH_ARGS(QVersionNumber, bluezDaemonVersion, (QVersionNumber()));
+Q_GLOBAL_STATIC_WITH_ARGS(Bluez5TestResult, bluezVersion, (BluezVersionUnknown))
+Q_GLOBAL_STATIC_WITH_ARGS(QVersionNumber, bluezDaemonVersion, (QVersionNumber()))
+
+/*
+ Ensures that the DBus types are registered
+ */
-bool isBluez5()
+void initializeBluez5()
{
if (*bluezVersion() == BluezVersionUnknown) {
OrgFreedesktopDBusObjectManagerInterface manager(QStringLiteral("org.bluez"),
QStringLiteral("/"),
QDBusConnection::systemBus());
-
qDBusRegisterMetaType<InterfaceList>();
qDBusRegisterMetaType<ManagedObjectList>();
qDBusRegisterMetaType<ManufacturerDataList>();
+ qDBusRegisterMetaType<ServiceDataList>();
QDBusPendingReply<ManagedObjectList> reply = manager.GetManagedObjects();
reply.waitForFinished();
if (reply.isError()) {
- // not Bluez 5.x
- OrgBluezManagerInterface manager_bluez4(QStringLiteral("org.bluez"),
- QStringLiteral("/"),
- QDBusConnection::systemBus());
- QDBusPendingReply<QList<QDBusObjectPath> > reply
- = manager_bluez4.ListAdapters();
- reply.waitForFinished();
- if (reply.isError()) {
- *bluezVersion() = BluezNotAvailable;
- qWarning() << "Cannot find a running Bluez. Please check the Bluez installation.";
- } else {
- *bluezVersion() = BluezVersion4;
- qCDebug(QT_BT_BLUEZ) << "Bluez 4 detected.";
- }
+ *bluezVersion() = BluezNotAvailable;
+ qWarning() << "Cannot find a compatible running Bluez. "
+ "Please check the Bluez installation. "
+ "QtBluetooth requires at least BlueZ version 5.";
} else {
*bluezVersion() = BluezVersion5;
qCDebug(QT_BT_BLUEZ) << "Bluez 5 detected.";
}
}
-
- return (*bluezVersion() == BluezVersion5);
}
/*
@@ -177,7 +137,7 @@ bool mandatoryHciIoctlsAvailable()
return true;
}
-/*!
+/*
* This function returns the version of bluetoothd in use on the system.
* This is required to determine which QLEControllerPrivate implementation
* is required. The following version tags are of significance:
@@ -201,6 +161,7 @@ QVersionNumber bluetoothdVersion()
qDBusRegisterMetaType<InterfaceList>();
qDBusRegisterMetaType<ManagedObjectList>();
qDBusRegisterMetaType<ManufacturerDataList>();
+ qDBusRegisterMetaType<ServiceDataList>();
qCDebug(QT_BT_BLUEZ) << "Detecting bluetoothd version";
//Order of matching
@@ -358,11 +319,7 @@ QtBluezDiscoveryManager::~QtBluezDiscoveryManager()
QtBluezDiscoveryManager *QtBluezDiscoveryManager::instance()
{
- if (isBluez5())
- return discoveryManager();
-
- Q_ASSERT(false);
- return nullptr;
+ return discoveryManager();
}
bool QtBluezDiscoveryManager::registerDiscoveryInterest(const QString &adapterPath)
@@ -380,8 +337,8 @@ bool QtBluezDiscoveryManager::registerDiscoveryInterest(const QString &adapterPa
OrgFreedesktopDBusPropertiesInterface *propIface = new OrgFreedesktopDBusPropertiesInterface(
QStringLiteral("org.bluez"), adapterPath, QDBusConnection::systemBus());
- connect(propIface, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)),
- SLOT(PropertiesChanged(QString,QVariantMap,QStringList)));
+ connect(propIface, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged,
+ this, &QtBluezDiscoveryManager::PropertiesChanged);
data->propteryListener = propIface;
OrgBluezAdapter1Interface iface(QStringLiteral("org.bluez"), adapterPath,
@@ -444,7 +401,8 @@ void QtBluezDiscoveryManager::InterfacesRemoved(const QDBusObjectPath &object_pa
void QtBluezDiscoveryManager::PropertiesChanged(const QString &interface,
const QVariantMap &changed_properties,
- const QStringList &invalidated_properties)
+ const QStringList &invalidated_properties,
+ const QDBusMessage &)
{
Q_UNUSED(invalidated_properties);
@@ -489,7 +447,7 @@ void QtBluezDiscoveryManager::removeAdapterFromMonitoring(const QString &dbusPat
emit discoveryInterrupted(dbusPath);
}
-/*!
+/*
Finds the path for the local adapter with \a wantedAddress or an empty string
if no local adapter with the given address can be found.
If \a wantedAddress is \c null it returns the first/default adapter or an empty
@@ -545,7 +503,7 @@ QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok =
if (wantedAddress.isNull())
return localAdapters.front().first; // -> return first found adapter
- for (const AddressForPathType &pair : qAsConst(localAdapters)) {
+ for (const AddressForPathType &pair : std::as_const(localAdapters)) {
if (pair.second == wantedAddress)
return pair.first; // -> found local adapter with wanted address
}
@@ -554,6 +512,43 @@ QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok =
}
/*
+
+ Checks the presence of peripheral interface and returns path to the adapter
+
+*/
+
+QString adapterWithDBusPeripheralInterface(const QBluetoothAddress &localAddress)
+{
+ initializeBluez5();
+
+ // First find the object path to the desired adapter
+ bool ok = false;
+ const QString hostAdapterPath = findAdapterForAddress(localAddress, &ok);
+ if (!ok || hostAdapterPath.isEmpty())
+ return {};
+
+ // Then check if that adapter provides peripheral dbus interface
+ OrgFreedesktopDBusObjectManagerInterface manager(QStringLiteral("org.bluez"),
+ QStringLiteral("/"),
+ QDBusConnection::systemBus());
+ QDBusPendingReply<ManagedObjectList> reply = manager.GetManagedObjects();
+ reply.waitForFinished();
+ if (reply.isError())
+ return {};
+
+ using namespace Qt::StringLiterals;
+ // For example /org/bluez/hci0 contains org.bluezLEAdvertisingManager1
+ const bool peripheralSupported = reply.value()
+ .value(QDBusObjectPath(hostAdapterPath))
+ .contains("org.bluez.LEAdvertisingManager1"_L1);
+
+ qCDebug(QT_BT_BLUEZ) << "Peripheral role"
+ << (peripheralSupported ? "" : "not")
+ << "supported on" << hostAdapterPath;
+ return peripheralSupported ? hostAdapterPath : QString{};
+}
+
+/*
Removes every character that cannot be used in QDbusObjectPath
See QDbusUtil::isValidObjectPath(QString) for more details.
@@ -561,7 +556,7 @@ QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok =
QString sanitizeNameForDBus(const QString &text)
{
QString appName = text;
- for (int i = 0; i < appName.length(); i++) {
+ for (qsizetype i = 0; i < appName.size(); ++i) {
ushort us = appName[i].unicode();
bool valid = (us >= 'a' && us <= 'z')
|| (us >= 'A' && us <= 'Z')
@@ -576,3 +571,5 @@ QString sanitizeNameForDBus(const QString &text)
}
QT_END_NAMESPACE
+
+#include "moc_bluez5_helper_p.cpp"
diff --git a/src/bluetooth/bluez/bluez5_helper_p.h b/src/bluetooth/bluez/bluez5_helper_p.h
index 0db6f29f..f16566d4 100644
--- a/src/bluetooth/bluez/bluez5_helper_p.h
+++ b/src/bluetooth/bluez/bluez5_helper_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BLUEZ5_HELPER_H
#define BLUEZ5_HELPER_H
@@ -53,28 +17,34 @@
#include <QtCore/QObject>
#include <QtDBus/QtDBus>
+#include <QtBluetooth/QBluetoothUuid>
#include <QtBluetooth/QBluetoothAddress>
#include <QtBluetooth/private/qtbluetoothglobal_p.h>
typedef QMap<QString, QVariantMap> InterfaceList;
typedef QMap<QDBusObjectPath, InterfaceList> ManagedObjectList;
typedef QMap<quint16, QDBusVariant> ManufacturerDataList;
+typedef QMap<QString, QDBusVariant> ServiceDataList;
-Q_DECLARE_METATYPE(InterfaceList)
-Q_DECLARE_METATYPE(ManufacturerDataList)
-Q_DECLARE_METATYPE(ManagedObjectList)
+QT_DECL_METATYPE_EXTERN(InterfaceList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(ManufacturerDataList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(ServiceDataList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(ManagedObjectList, /* not exported */)
QT_BEGIN_NAMESPACE
+void initializeBluez5();
bool isBluez5();
// exported for unit test purposes
-Q_BLUETOOTH_PRIVATE_EXPORT QVersionNumber bluetoothdVersion();
+Q_BLUETOOTH_EXPORT QVersionNumber bluetoothdVersion();
QString sanitizeNameForDBus(const QString& text);
QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok);
+QString adapterWithDBusPeripheralInterface(const QBluetoothAddress &localAddress);
+
class QtBluezDiscoveryManagerPrivate;
class QtBluezDiscoveryManager : public QObject
{
@@ -97,7 +67,8 @@ private slots:
const QStringList &interfaces);
void PropertiesChanged(const QString &interface,
const QVariantMap &changed_properties,
- const QStringList &invalidated_properties);
+ const QStringList &invalidated_properties,
+ const QDBusMessage &msg);
private:
void removeAdapterFromMonitoring(const QString &dbusPath);
diff --git a/src/bluetooth/bluez/bluez_data.cpp b/src/bluetooth/bluez/bluez_data.cpp
new file mode 100644
index 00000000..8ffd23be
--- /dev/null
+++ b/src/bluetooth/bluez/bluez_data.cpp
@@ -0,0 +1,10 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "bluez_data_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QT_END_NAMESPACE
+
+#include "moc_bluez_data_p.cpp"
diff --git a/src/bluetooth/bluez/bluez_data_p.h b/src/bluetooth/bluez/bluez_data_p.h
index 2a2e597c..65ddeb97 100644
--- a/src/bluetooth/bluez/bluez_data_p.h
+++ b/src/bluetooth/bluez/bluez_data_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BLUEZ_DATA_P_H
#define BLUEZ_DATA_P_H
@@ -51,10 +15,11 @@
// We mean it.
//
-#include <QtCore/qglobal.h>
+#include <QtCore/private/qglobal_p.h>
#include <QtCore/qendian.h>
#include <sys/socket.h>
#include <QtBluetooth/QBluetoothUuid>
+#include <QtCore/qtmetamacros.h>
QT_BEGIN_NAMESPACE
@@ -127,6 +92,9 @@ struct bt_security {
#define HCIGETDEVINFO _IOR('H', 211, int)
#define HCIGETDEVLIST _IOR('H', 210, int)
+// Generic 128 bits of data
+typedef QUuid::Id128Bytes BluezUint128;
+
// Bluetooth address
typedef struct {
quint8 b[6];
@@ -152,39 +120,6 @@ struct sockaddr_rc {
// Bt Low Energy related
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-
-static inline void btoh128(const quint128 *src, quint128 *dst)
-{
- memcpy(dst, src, sizeof(quint128));
-}
-
-static inline void ntoh128(const quint128 *src, quint128 *dst)
-{
- int i;
-
- for (i = 0; i < 16; i++)
- dst->data[15 - i] = src->data[i];
-}
-
-#elif __BYTE_ORDER == __BIG_ENDIAN
-
-static inline void btoh128(const quint128 *src, quint128 *dst)
-{
- int i;
-
- for (i = 0; i < 16; i++)
- dst->data[15 - i] = src->data[i];
-}
-
-static inline void ntoh128(const quint128 *src, quint128 *dst)
-{
- memcpy(dst, src, sizeof(quint128));
-}
-#else
-#error "Unknown byte order"
-#endif
-
template<typename T> inline T getBtData(const void *ptr)
{
return qFromLittleEndian<T>(reinterpret_cast<const uchar *>(ptr));
@@ -199,12 +134,6 @@ template<typename T> inline void putBtData(T src, void *dst)
{
qToLittleEndian(src, reinterpret_cast<uchar *>(dst));
}
-template<> inline void putBtData(quint128 src, void *dst)
-{
- btoh128(&src, reinterpret_cast<quint128 *>(dst));
-}
-
-#define hton128(x, y) ntoh128(x, y)
// HCI related
@@ -344,7 +273,6 @@ typedef struct {
} __attribute__ ((packed)) hci_event_hdr;
#define HCI_EVENT_HDR_SIZE 2
-#define EVT_ENCRYPT_CHANGE 0x08
typedef struct {
quint8 status;
quint16 handle;
@@ -352,7 +280,6 @@ typedef struct {
} __attribute__ ((packed)) evt_encrypt_change;
#define EVT_ENCRYPT_CHANGE_SIZE 4
-#define EVT_CMD_COMPLETE 0x0E
struct evt_cmd_complete {
quint8 ncmd;
quint16 opcode;
@@ -375,21 +302,88 @@ struct hci_command_hdr {
quint8 plen;
} __attribute__ ((packed));
-enum OpCodeGroupField {
- OgfLinkControl = 0x8,
-};
-
-enum OpCodeCommandField {
- OcfLeSetAdvParams = 0x6,
- OcfLeReadTxPowerLevel = 0x7,
- OcfLeSetAdvData = 0x8,
- OcfLeSetScanResponseData = 0x9,
- OcfLeSetAdvEnable = 0xa,
- OcfLeClearWhiteList = 0x10,
- OcfLeAddToWhiteList = 0x11,
- OcfLeConnectionUpdate = 0x13,
-};
-
+namespace QBluezConst {
+ Q_NAMESPACE
+ enum OpCodeGroupField {
+ OgfLinkControl = 0x8,
+ };
+ Q_ENUM_NS(OpCodeGroupField)
+
+ enum OpCodeCommandField {
+ OcfLeSetAdvParams = 0x6,
+ OcfLeReadTxPowerLevel = 0x7,
+ OcfLeSetAdvData = 0x8,
+ OcfLeSetScanResponseData = 0x9,
+ OcfLeSetAdvEnable = 0xa,
+ OcfLeClearWhiteList = 0x10,
+ OcfLeAddToWhiteList = 0x11,
+ OcfLeConnectionUpdate = 0x13,
+ };
+ Q_ENUM_NS(OpCodeCommandField)
+
+ enum class AttCommand : quint8 {
+ ATT_OP_ERROR_RESPONSE = 0x01,
+ ATT_OP_EXCHANGE_MTU_REQUEST = 0x02, //send own mtu
+ ATT_OP_EXCHANGE_MTU_RESPONSE = 0x03, //receive server MTU
+ ATT_OP_FIND_INFORMATION_REQUEST = 0x04, //discover individual attribute info
+ ATT_OP_FIND_INFORMATION_RESPONSE = 0x05,
+ ATT_OP_FIND_BY_TYPE_VALUE_REQUEST = 0x06,
+ ATT_OP_FIND_BY_TYPE_VALUE_RESPONSE = 0x07,
+ ATT_OP_READ_BY_TYPE_REQUEST = 0x08, //discover characteristics
+ ATT_OP_READ_BY_TYPE_RESPONSE = 0x09,
+ ATT_OP_READ_REQUEST = 0x0A, //read characteristic & descriptor values
+ ATT_OP_READ_RESPONSE = 0x0B,
+ ATT_OP_READ_BLOB_REQUEST = 0x0C, //read values longer than MTU-1
+ ATT_OP_READ_BLOB_RESPONSE = 0x0D,
+ ATT_OP_READ_MULTIPLE_REQUEST = 0x0E,
+ ATT_OP_READ_MULTIPLE_RESPONSE = 0x0F,
+ ATT_OP_READ_BY_GROUP_REQUEST = 0x10, //discover services
+ ATT_OP_READ_BY_GROUP_RESPONSE = 0x11,
+ ATT_OP_WRITE_REQUEST = 0x12, //write characteristic with response
+ ATT_OP_WRITE_RESPONSE = 0x13,
+ ATT_OP_PREPARE_WRITE_REQUEST = 0x16, //write values longer than MTU-3 -> queueing
+ ATT_OP_PREPARE_WRITE_RESPONSE = 0x17,
+ ATT_OP_EXECUTE_WRITE_REQUEST = 0x18, //write values longer than MTU-3 -> execute queue
+ ATT_OP_EXECUTE_WRITE_RESPONSE = 0x19,
+ ATT_OP_HANDLE_VAL_NOTIFICATION = 0x1b, //informs about value change
+ ATT_OP_HANDLE_VAL_INDICATION = 0x1d, //informs about value change -> requires reply
+ ATT_OP_HANDLE_VAL_CONFIRMATION = 0x1e, //answer for ATT_OP_HANDLE_VAL_INDICATION
+ ATT_OP_WRITE_COMMAND = 0x52, //write characteristic without response
+ ATT_OP_SIGNED_WRITE_COMMAND = 0xD2
+ };
+ Q_ENUM_NS(AttCommand)
+
+ enum class AttError : quint8 {
+ ATT_ERROR_NO_ERROR = 0x00,
+ ATT_ERROR_INVALID_HANDLE = 0x01,
+ ATT_ERROR_READ_NOT_PERM = 0x02,
+ ATT_ERROR_WRITE_NOT_PERM = 0x03,
+ ATT_ERROR_INVALID_PDU = 0x04,
+ ATT_ERROR_INSUF_AUTHENTICATION = 0x05,
+ ATT_ERROR_REQUEST_NOT_SUPPORTED = 0x06,
+ ATT_ERROR_INVALID_OFFSET = 0x07,
+ ATT_ERROR_INSUF_AUTHORIZATION = 0x08,
+ ATT_ERROR_PREPARE_QUEUE_FULL = 0x09,
+ ATT_ERROR_ATTRIBUTE_NOT_FOUND = 0x0A,
+ ATT_ERROR_ATTRIBUTE_NOT_LONG = 0x0B,
+ ATT_ERROR_INSUF_ENCR_KEY_SIZE = 0x0C,
+ ATT_ERROR_INVAL_ATTR_VALUE_LEN = 0x0D,
+ ATT_ERROR_UNLIKELY = 0x0E,
+ ATT_ERROR_INSUF_ENCRYPTION = 0x0F,
+ ATT_ERROR_UNSUPPRTED_GROUP_TYPE = 0x10,
+ ATT_ERROR_INSUF_RESOURCES = 0x11,
+ ATT_ERROR_APPLICATION_START = 0x80,
+ //------------------------------------------
+ // The error codes in this block are
+ // implementation specific errors
+
+ ATT_ERROR_REQUEST_STALLED = 0x81,
+
+ //------------------------------------------
+ ATT_ERROR_APPLICATION_END = 0x9f
+ };
+ Q_ENUM_NS(AttError)
+}
/* Command opcode pack/unpack */
#define opCodePack(ogf, ocf) (quint16(((ocf) & 0x03ff)|((ogf) << 10)))
#define ogfFromOpCode(op) ((op) >> 10)
diff --git a/src/bluetooth/bluez/bluezperipheralapplication.cpp b/src/bluetooth/bluez/bluezperipheralapplication.cpp
new file mode 100644
index 00000000..5a8e4899
--- /dev/null
+++ b/src/bluetooth/bluez/bluezperipheralapplication.cpp
@@ -0,0 +1,280 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "bluezperipheralapplication_p.h"
+#include "bluezperipheralobjects_p.h"
+#include "objectmanageradaptor_p.h"
+#include "gattmanager1_p.h"
+
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ)
+
+using namespace Qt::StringLiterals;
+
+static constexpr QLatin1String appObjectPathTemplate{"/qt/btle/application/%1%2/%3"};
+
+QtBluezPeripheralApplication::QtBluezPeripheralApplication(const QString& hostAdapterPath,
+ QObject* parent)
+ : QObject(parent),
+ m_objectPath(QString(appObjectPathTemplate).
+ arg(sanitizeNameForDBus(QCoreApplication::applicationName())).
+ arg(QCoreApplication::applicationPid()).
+ arg(QRandomGenerator::global()->generate()))
+{
+ m_objectManager = new OrgFreedesktopDBusObjectManagerAdaptor(this);
+ m_gattManager = new OrgBluezGattManager1Interface("org.bluez"_L1, hostAdapterPath,
+ QDBusConnection::systemBus(), this);
+}
+
+QtBluezPeripheralApplication::~QtBluezPeripheralApplication()
+{
+ unregisterApplication();
+}
+
+void QtBluezPeripheralApplication::registerApplication()
+{
+ if (m_applicationRegistered) {
+ // Can happen eg. if advertisement is start-stop-started
+ qCDebug(QT_BT_BLUEZ) << "Bluez peripheral application already registered";
+ return;
+ }
+
+ if (m_services.isEmpty()) {
+ // Registering the application to bluez without services would fail
+ qCDebug(QT_BT_BLUEZ) << "No services, omiting Bluez peripheral application registration";
+ return;
+ }
+
+ qCDebug(QT_BT_BLUEZ) << "Registering bluez peripheral application:" << m_objectPath;
+
+ // Register this application object on DBus
+ if (!QDBusConnection::systemBus().registerObject(m_objectPath, m_objectManager,
+ QDBusConnection::ExportAllContents)) {
+ qCWarning(QT_BT_BLUEZ) << "Peripheral application object registration failed";
+ emit errorOccurred();
+ return;
+ }
+
+ // Register the service objects on DBus
+ registerServices();
+
+ // Register the gatt application to Bluez. After successful registration Bluez
+ // is aware of this peripheral application and will inquiry which services this application
+ // provides, see GetManagedObjects()
+ auto reply = m_gattManager->RegisterApplication(QDBusObjectPath(m_objectPath), {});
+ QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(reply, this);
+ QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this,
+ [this](QDBusPendingCallWatcher* watcher) {
+ QDBusPendingReply<> reply = *watcher;
+ if (reply.isError()) {
+ qCWarning(QT_BT_BLUEZ) << "Application registration failed" << reply.error();
+ QDBusConnection::systemBus().unregisterObject(m_objectPath);
+ emit errorOccurred();
+ } else {
+ qCDebug(QT_BT_BLUEZ) << "Peripheral application registered as" << m_objectPath;
+ m_applicationRegistered = true;
+ emit registered();
+ }
+ watcher->deleteLater();
+ });
+}
+
+void QtBluezPeripheralApplication::unregisterApplication()
+{
+ if (!m_applicationRegistered)
+ return;
+ m_applicationRegistered = false;
+ auto reply = m_gattManager->UnregisterApplication(QDBusObjectPath(m_objectPath));
+ reply.waitForFinished();
+ if (reply.isError())
+ qCWarning(QT_BT_BLUEZ) << "Error in unregistering peripheral application";
+ else
+ qCDebug(QT_BT_BLUEZ) << "Peripheral application unregistered successfully";
+ QDBusConnection::systemBus().unregisterObject(m_objectPath);
+ unregisterServices();
+
+ qCDebug(QT_BT_BLUEZ) << "Unregistered Bluez peripheral application on DBus:" << m_objectPath;
+}
+
+void QtBluezPeripheralApplication::registerServices()
+{
+ // Register the service objects on DBus
+ for (const auto service: std::as_const(m_services))
+ service->registerObject();
+ for (const auto& characteristic : std::as_const(m_characteristics))
+ characteristic->registerObject();
+ for (const auto& descriptor : std::as_const(m_descriptors))
+ descriptor->registerObject();
+}
+
+void QtBluezPeripheralApplication::unregisterServices()
+{
+ // Unregister the service objects from DBus
+ for (const auto service: std::as_const(m_services))
+ service->unregisterObject();
+ for (const auto& characteristic : std::as_const(m_characteristics))
+ characteristic->unregisterObject();
+ for (const auto& descriptor : std::as_const(m_descriptors))
+ descriptor->unregisterObject();
+}
+
+void QtBluezPeripheralApplication::reset()
+{
+ unregisterApplication();
+
+ qDeleteAll(m_services);
+ m_services.clear();
+ qDeleteAll(m_descriptors);
+ m_descriptors.clear();
+ qDeleteAll(m_characteristics);
+ m_characteristics.clear();
+}
+
+void QtBluezPeripheralApplication::addService(const QLowEnergyServiceData &serviceData,
+ QSharedPointer<QLowEnergyServicePrivate> servicePrivate,
+ QLowEnergyHandle serviceHandle)
+{
+ if (m_applicationRegistered) {
+ qCWarning(QT_BT_BLUEZ) << "Adding services to a registered application is not supported "
+ "on Bluez DBus. Add services only before first advertisement or "
+ "after disconnection";
+ return;
+ }
+
+ // The ordinal numbers in the below object creation are used to create paths such as:
+ // ../service0/char0/desc0
+ // ../service0/char1/desc0
+ // ../service1/char0/desc0
+ // ../service1/char0/desc1
+ // For the Service object itself the ordinal number is the size of the service container
+ QtBluezPeripheralService* service = new QtBluezPeripheralService(
+ serviceData, m_objectPath, m_services.size(), serviceHandle, this);
+ m_services.insert(serviceHandle, service);
+
+ // Add included services
+ for (const auto includedService : serviceData.includedServices()) {
+ // As per Qt documentation the included service must have been added earlier
+ for (const auto s : std::as_const(m_services)) {
+ if (QBluetoothUuid(s->uuid) == includedService->serviceUuid()) {
+ service->addIncludedService(s->objectPath);
+ }
+ }
+ }
+
+ // Set characteristics and their descriptors
+ quint16 characteristicOrdinal{0};
+ for (const auto& characteristicData : serviceData.characteristics()) {
+ auto characteristicHandle = handleForCharacteristic(
+ characteristicData.uuid(), servicePrivate);
+ QtBluezPeripheralCharacteristic* characteristic =
+ new QtBluezPeripheralCharacteristic(characteristicData,
+ service->objectPath, characteristicOrdinal++,
+ characteristicHandle, this);
+ m_characteristics.insert(characteristicHandle, characteristic);
+ QObject::connect(characteristic, &QtBluezPeripheralCharacteristic::valueUpdatedByRemote,
+ this, &QtBluezPeripheralApplication::characteristicValueUpdatedByRemote);
+ QObject::connect(characteristic, &QtBluezPeripheralCharacteristic::remoteDeviceAccessEvent,
+ this, &QtBluezPeripheralApplication::remoteDeviceAccessEvent);
+
+ quint16 descriptorOrdinal{0};
+ for (const auto& descriptorData : characteristicData.descriptors()) {
+ // With bluez we don't use the CCCD user has provided, because Bluez
+ // generates it if 'notify/indicate' flag is set. Similarly the extended properties
+ // descriptor is generated by Bluez if the related flags are set. Using the application
+ // provided descriptors would result in duplicate descriptors.
+ if (descriptorData.uuid()
+ == QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration
+ || descriptorData.uuid()
+ == QBluetoothUuid::DescriptorType::CharacteristicExtendedProperties) {
+ continue;
+ }
+ auto descriptorHandle = handleForDescriptor(descriptorData.uuid(),
+ servicePrivate,
+ characteristicHandle);
+ QtBluezPeripheralDescriptor* descriptor =
+ new QtBluezPeripheralDescriptor(descriptorData,
+ characteristic->objectPath, descriptorOrdinal++,
+ descriptorHandle, characteristicHandle, this);
+ QObject::connect(descriptor, &QtBluezPeripheralDescriptor::valueUpdatedByRemote,
+ this, &QtBluezPeripheralApplication::descriptorValueUpdatedByRemote);
+ QObject::connect(descriptor, &QtBluezPeripheralCharacteristic::remoteDeviceAccessEvent,
+ this, &QtBluezPeripheralApplication::remoteDeviceAccessEvent);
+ m_descriptors.insert(descriptorHandle, descriptor);
+ }
+ }
+}
+
+// This function is called when characteristic is written to from Qt API
+bool QtBluezPeripheralApplication::localCharacteristicWrite(QLowEnergyHandle handle,
+ const QByteArray& value)
+{
+ auto characteristic = m_characteristics.value(handle);
+ if (!characteristic) {
+ qCWarning(QT_BT_BLUEZ) << "DBus characteristic not found for write";
+ return false;
+ }
+ return characteristic->localValueUpdate(value);
+}
+
+// This function is called when characteristic is written to from Qt API
+bool QtBluezPeripheralApplication::localDescriptorWrite(QLowEnergyHandle handle,
+ const QByteArray& value)
+{
+ auto descriptor = m_descriptors.value(handle);
+ if (!descriptor) {
+ qCWarning(QT_BT_BLUEZ) << "DBus descriptor not found for write";
+ return false;
+ }
+ return descriptor->localValueUpdate(value);
+}
+
+bool QtBluezPeripheralApplication::registrationNeeded()
+{
+ return !m_applicationRegistered && !m_services.isEmpty();
+}
+
+// org.freedesktop.DBus.ObjectManager
+// This is called by Bluez when we register the application
+ManagedObjectList QtBluezPeripheralApplication::GetManagedObjects()
+{
+ ManagedObjectList managedObjects;
+ for (const auto service: std::as_const(m_services))
+ managedObjects.insert(QDBusObjectPath(service->objectPath), service->properties());
+ for (const auto& charac : std::as_const(m_characteristics))
+ managedObjects.insert(QDBusObjectPath(charac->objectPath), charac->properties());
+ for (const auto& descriptor : std::as_const(m_descriptors))
+ managedObjects.insert(QDBusObjectPath(descriptor->objectPath), descriptor->properties());
+
+ return managedObjects;
+}
+
+// Returns the Qt-internal handle for the characteristic
+QLowEnergyHandle QtBluezPeripheralApplication::handleForCharacteristic(QBluetoothUuid uuid,
+ QSharedPointer<QLowEnergyServicePrivate> service)
+{
+ const auto handles = service->characteristicList.keys();
+ for (const auto handle : handles) {
+ if (uuid == service->characteristicList[handle].uuid)
+ return handle;
+ }
+ return 0;
+}
+
+// Returns the Qt-internal handle for the descriptor
+QLowEnergyHandle QtBluezPeripheralApplication::handleForDescriptor(QBluetoothUuid uuid,
+ QSharedPointer<QLowEnergyServicePrivate> service,
+ QLowEnergyHandle characteristicHandle)
+{
+ const auto characteristicData = service->characteristicList[characteristicHandle];
+ const auto handles = characteristicData.descriptorList.keys();
+ for (const auto handle : handles) {
+ if (uuid == characteristicData.descriptorList[handle].uuid)
+ return handle;
+ }
+ return 0;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_bluezperipheralapplication_p.cpp"
diff --git a/src/bluetooth/bluez/bluezperipheralapplication_p.h b/src/bluetooth/bluez/bluezperipheralapplication_p.h
new file mode 100644
index 00000000..1b8287b9
--- /dev/null
+++ b/src/bluetooth/bluez/bluezperipheralapplication_p.h
@@ -0,0 +1,100 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef BLUEZ_PERIPHERAL_APPLICATION_P_H
+#define BLUEZ_PERIPHERAL_APPLICATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtBluetooth/private/qlowenergycontroller_bluezdbus_p.h>
+#include "bluez5_helper_p.h"
+
+#include <QtBluetooth/QBluetoothAddress>
+#include <QtCore/QCoreApplication>
+
+class OrgFreedesktopDBusObjectManagerAdaptor;
+class OrgBluezGattManager1Interface;
+
+QT_BEGIN_NAMESPACE
+
+class QLowEnergyControllerPrivateBluezDBus;
+class QtBluezPeripheralService;
+class QtBluezPeripheralCharacteristic;
+class QtBluezPeripheralDescriptor;
+class QtBluezPeripheralConnectionManager;
+
+class QtBluezPeripheralApplication : public QObject
+{
+ Q_OBJECT
+
+public:
+ QtBluezPeripheralApplication(const QString& localAdapterPath, QObject* parent = nullptr);
+ ~QtBluezPeripheralApplication();
+
+ // Register the application and its services to DBus & Bluez
+ void registerApplication();
+ // Unregister the application and its services from DBus & Bluez.
+ // Calling this doesn't invalidate the services
+ void unregisterApplication();
+ // Unregister and release all resources, invalidates services
+ void reset();
+
+ void addService(const QLowEnergyServiceData &serviceData,
+ QSharedPointer<QLowEnergyServicePrivate> servicePrivate,
+ QLowEnergyHandle serviceHandle);
+
+ // Call these when the user application has updated the attribute value
+ // Returns whether the new value was accepted
+ bool localCharacteristicWrite(QLowEnergyHandle handle, const QByteArray& value);
+ bool localDescriptorWrite(QLowEnergyHandle handle, const QByteArray& value);
+
+ // Returns true if application has services and is not registered
+ bool registrationNeeded();
+
+ // org.freedesktop.DBus.ObjectManager
+ Q_INVOKABLE ManagedObjectList GetManagedObjects();
+
+signals:
+ void errorOccurred();
+ void registered();
+
+ // Emitted when remote device reads a characteristic
+ void remoteDeviceAccessEvent(const QString& remoteDeviceObjectPath, quint16 mtu);
+
+ // These are emitted when remote has written a new value
+ void characteristicValueUpdatedByRemote(QLowEnergyHandle handle, const QByteArray& value);
+ void descriptorValueUpdatedByRemote(QLowEnergyHandle characteristicHandle,
+ QLowEnergyHandle descriptorHandle,
+ const QByteArray& value);
+private:
+ void registerServices();
+ void unregisterServices();
+
+ QLowEnergyHandle handleForCharacteristic(QBluetoothUuid uuid,
+ QSharedPointer<QLowEnergyServicePrivate> service);
+ QLowEnergyHandle handleForDescriptor(QBluetoothUuid uuid,
+ QSharedPointer<QLowEnergyServicePrivate> service,
+ QLowEnergyHandle characteristicHandle);
+
+ QMap<QLowEnergyHandle, QtBluezPeripheralService*> m_services;
+ QMap<QLowEnergyHandle, QtBluezPeripheralCharacteristic*> m_characteristics;
+ QMap<QLowEnergyHandle, QtBluezPeripheralDescriptor*> m_descriptors;
+
+ QString m_objectPath;
+ OrgFreedesktopDBusObjectManagerAdaptor* m_objectManager{};
+ OrgBluezGattManager1Interface* m_gattManager{};
+ bool m_applicationRegistered{false};
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/bluetooth/bluez/bluezperipheralconnectionmanager.cpp b/src/bluetooth/bluez/bluezperipheralconnectionmanager.cpp
new file mode 100644
index 00000000..64350d2d
--- /dev/null
+++ b/src/bluetooth/bluez/bluezperipheralconnectionmanager.cpp
@@ -0,0 +1,96 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "bluezperipheralconnectionmanager_p.h"
+#include "device1_bluez5_p.h"
+
+#include <QtBluetooth/QBluetoothLocalDevice>
+#include <QtDBus/QDBusConnection>
+#include <QtCore/QLoggingCategory>
+
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ)
+
+using namespace Qt::StringLiterals;
+
+QtBluezPeripheralConnectionManager::QtBluezPeripheralConnectionManager(
+ const QBluetoothAddress& localAddress, QObject* parent)
+ : QObject(parent),
+ m_localDevice(new QBluetoothLocalDevice(localAddress, this))
+{
+ QObject::connect(m_localDevice, &QBluetoothLocalDevice::deviceDisconnected,
+ this, &QtBluezPeripheralConnectionManager::remoteDeviceDisconnected);
+}
+
+void QtBluezPeripheralConnectionManager::remoteDeviceAccessEvent(
+ const QString& remoteDeviceObjectPath, quint16 mtu)
+{
+ if (m_clients.contains(remoteDeviceObjectPath))
+ return; // Already aware of the client
+
+ std::unique_ptr<OrgBluezDevice1Interface> device{new OrgBluezDevice1Interface(
+ "org.bluez"_L1, remoteDeviceObjectPath,
+ QDBusConnection::systemBus(), this)};
+
+ qCDebug(QT_BT_BLUEZ) << "New LE Gatt client connected: " << remoteDeviceObjectPath
+ << device->address() << device->name() << "mtu:" << mtu;
+
+ RemoteDeviceDetails details{QBluetoothAddress{device->address()}, device->name(), mtu};
+
+ m_clients.insert(remoteDeviceObjectPath, details);
+ if (!m_connected) {
+ m_connected = true;
+ emit connectivityStateChanged(true);
+ }
+ emit remoteDeviceChanged(details.address, details.name, details.mtu);
+}
+
+void QtBluezPeripheralConnectionManager::remoteDeviceDisconnected(const QBluetoothAddress& address)
+{
+ // Find if the disconnected device was gatt client
+ bool remoteDetailsChanged{false};
+ for (auto it = m_clients.begin(); it != m_clients.end(); it++) {
+ if (it.value().address == address) {
+ qCDebug(QT_BT_BLUEZ) << "LE Gatt client disconnected:" << address;
+ remoteDetailsChanged = true;
+ m_clients.remove(it.key());
+ break;
+ }
+ }
+
+ if (!remoteDetailsChanged)
+ return;
+
+ if (m_clients.isEmpty() && m_connected) {
+ m_connected = false;
+ emit connectivityStateChanged(false);
+ }
+
+ // If a client disconnected but there are others, pick any other.
+ // Qt API doesn't distinguish between clients
+ if (!m_clients.isEmpty()) {
+ emit remoteDeviceChanged(m_clients.last().address,
+ m_clients.last().name, m_clients.last().mtu);
+ }
+}
+
+void QtBluezPeripheralConnectionManager::disconnectDevices()
+{
+ for (auto it = m_clients.begin(); it != m_clients.end(); it++) {
+ std::unique_ptr<OrgBluezDevice1Interface> device{new OrgBluezDevice1Interface(
+ "org.bluez"_L1, it.key(), QDBusConnection::systemBus())};
+ device->Disconnect();
+ }
+ reset();
+}
+
+void QtBluezPeripheralConnectionManager::reset()
+{
+ m_connected = false;
+ m_clients.clear();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_bluezperipheralconnectionmanager_p.cpp"
diff --git a/src/bluetooth/bluez/bluezperipheralconnectionmanager_p.h b/src/bluetooth/bluez/bluezperipheralconnectionmanager_p.h
new file mode 100644
index 00000000..42e839cc
--- /dev/null
+++ b/src/bluetooth/bluez/bluezperipheralconnectionmanager_p.h
@@ -0,0 +1,68 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef BLUEZ_PERIPHERAL_CONNECTION_MANAGER_P_H
+#define BLUEZ_PERIPHERAL_CONNECTION_MANAGER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtBluetooth/QBluetoothAddress>
+#include <QtBluetooth/QBluetoothUuid>
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+
+class QBluetoothLocalDevice;
+
+/*
+ QtBluezPeripheralConnectionManager determines
+ - when remote Gatt client(s) connect and disconnect
+ - the remote device details (name, address, mtu)
+
+ 'Connected' state is assumed when first client reads a characteristic.
+ 'Disconnected' state is assumed when all such clients have disconnected.
+*/
+
+class QtBluezPeripheralConnectionManager : public QObject
+{
+ Q_OBJECT
+public:
+ QtBluezPeripheralConnectionManager(const QBluetoothAddress& localAddress,
+ QObject* parent = nullptr);
+ void reset();
+ void disconnectDevices();
+
+public slots:
+ void remoteDeviceAccessEvent(const QString& remoteDeviceObjectPath, quint16 mtu);
+
+signals:
+ void connectivityStateChanged(bool connected);
+ void remoteDeviceChanged(const QBluetoothAddress& address, const QString& name, quint16 mtu);
+
+private slots:
+ void remoteDeviceDisconnected(const QBluetoothAddress& address);
+
+private:
+ struct RemoteDeviceDetails {
+ QBluetoothAddress address;
+ QString name;
+ quint16 mtu;
+ };
+ bool m_connected{false};
+ QString m_hostAdapterPath;
+ QMap<QString, RemoteDeviceDetails> m_clients;
+ QBluetoothLocalDevice* m_localDevice;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/bluetooth/bluez/bluezperipheralobjects.cpp b/src/bluetooth/bluez/bluezperipheralobjects.cpp
new file mode 100644
index 00000000..1caa42cd
--- /dev/null
+++ b/src/bluetooth/bluez/bluezperipheralobjects.cpp
@@ -0,0 +1,403 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "bluezperipheralobjects_p.h"
+
+#include "propertiesadaptor_p.h"
+#include "gattservice1adaptor_p.h"
+#include "gattcharacteristic1adaptor_p.h"
+#include "gattdescriptor1adaptor_p.h"
+
+#include <QtCore/QLoggingCategory>
+#include <QtDBus/QDBusConnection>
+
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ)
+
+using namespace Qt::StringLiterals;
+
+static constexpr auto characteristicPathTemplate{"%1/char%2"_L1};
+static constexpr auto descriptorPathTemplate{"%1/desc%2"_L1};
+static constexpr auto servicePathTemplate{"%1/service%2"_L1};
+
+// The interface names and error values are from BlueZ "gatt-api" documentation
+static constexpr auto bluezServiceInterface{"org.bluez.GattService1"_L1};
+static constexpr auto bluezCharacteristicInterface{"org.bluez.GattCharacteristic1"_L1};
+static constexpr auto bluezDescriptorInterface{"org.bluez.GattDescriptor1"_L1};
+
+static constexpr auto bluezErrorInvalidValueLength{"org.bluez.Error.InvalidValueLength"_L1};
+static constexpr auto bluezErrorInvalidOffset{"org.bluez.Error.InvalidOffset"_L1};
+static constexpr auto bluezErrorNotAuthorized{"org.bluez.Error.NotAuthorized"_L1};
+// Bluetooth Core v5.3, 3.2.9, Vol 3, Part F
+static constexpr int maximumAttributeLength{512};
+
+
+QtBluezPeripheralGattObject::QtBluezPeripheralGattObject(const QString& objectPath,
+ const QString& uuid, QLowEnergyHandle handle, QObject* parent)
+ : QObject(parent), objectPath(objectPath), uuid(uuid), handle(handle),
+ propertiesAdaptor(new OrgFreedesktopDBusPropertiesAdaptor(this))
+{}
+
+QtBluezPeripheralGattObject::~QtBluezPeripheralGattObject()
+{
+ unregisterObject();
+}
+
+bool QtBluezPeripheralGattObject::registerObject()
+{
+ if (m_registered)
+ return true;
+
+ if (QDBusConnection::systemBus().registerObject(objectPath, this)) {
+ qCDebug(QT_BT_BLUEZ) << "Registered object on DBus:" << objectPath << uuid;
+ m_registered = true;
+ return true;
+ } else {
+ qCWarning(QT_BT_BLUEZ) << "Failed to register object on DBus:" << objectPath << uuid;
+ return false;
+ }
+}
+
+void QtBluezPeripheralGattObject::unregisterObject()
+{
+ if (!m_registered)
+ return;
+ QDBusConnection::systemBus().unregisterObject(objectPath);
+ qCDebug(QT_BT_BLUEZ) << "Unregistered object on DBus:" << objectPath << uuid;
+ m_registered = false;
+}
+
+void QtBluezPeripheralGattObject::accessEvent(const QVariantMap& options)
+{
+ // Report this event for connection management purposes
+ const auto remoteDevice = options.value("device"_L1).value<QDBusObjectPath>().path();
+ if (!remoteDevice.isEmpty())
+ emit remoteDeviceAccessEvent(remoteDevice, options.value("mtu"_L1).toUInt());
+}
+
+QtBluezPeripheralDescriptor::QtBluezPeripheralDescriptor(
+ const QLowEnergyDescriptorData& descriptorData,
+ const QString& characteristicPath, quint16 ordinal,
+ QLowEnergyHandle handle, QLowEnergyHandle characteristicHandle,
+ QObject* parent)
+ : QtBluezPeripheralGattObject(descriptorPathTemplate.arg(characteristicPath).arg(ordinal),
+ descriptorData.uuid().toString(QUuid::WithoutBraces), handle, parent),
+ m_adaptor(new OrgBluezGattDescriptor1Adaptor(this)),
+ m_characteristicPath(characteristicPath),
+ m_characteristicHandle(characteristicHandle)
+{
+ if (descriptorData.value().size() > maximumAttributeLength) {
+ qCWarning(QT_BT_BLUEZ) << "Descriptor value is too large, cropping it to"
+ << maximumAttributeLength;
+ m_value = descriptorData.value().sliced(0, maximumAttributeLength);
+ } else {
+ m_value = descriptorData.value();
+ }
+ initializeFlags(descriptorData);
+}
+
+InterfaceList QtBluezPeripheralDescriptor::properties() const
+{
+ InterfaceList properties;
+ properties.insert(bluezDescriptorInterface,
+ {
+ {"UUID"_L1, uuid},
+ {"Characteristic"_L1, QDBusObjectPath(m_characteristicPath)},
+ {"Flags"_L1, m_flags}
+ });
+ return properties;
+}
+
+// org.bluez.GattDescriptor1
+// This function is invoked when remote device reads the value
+QByteArray QtBluezPeripheralDescriptor::ReadValue(const QVariantMap &options, QString& error)
+{
+ accessEvent(options);
+ // Offset is set by Bluez when the value size is more than MTU size.
+ // Bluez deduces the value size from the first ReadValue. If the
+ // received data size is larger than MTU, Bluez will take the first MTU bytes and
+ // issue more ReadValue calls with the 'offset' set
+ const quint16 offset = options.value("offset"_L1).toUInt();
+ const quint16 mtu = options.value("mtu"_L1).toUInt();
+
+ if (offset > m_value.length() - 1) {
+ qCWarning(QT_BT_BLUEZ) << "Invalid offset" << offset << ", value len:" << m_value.length();
+ error = bluezErrorInvalidOffset;
+ return {};
+ }
+
+ if (offset > 0)
+ return m_value.mid(offset, mtu);
+ else
+ return m_value;
+}
+
+// org.bluez.GattDescriptor1
+// This function is invoked when remote device writes a value
+QString QtBluezPeripheralDescriptor::WriteValue(const QByteArray &value,
+ const QVariantMap &options)
+{
+ accessEvent(options);
+
+ if (options.value("prepare-authorize"_L1).toBool()) {
+ // Qt API doesn't provide the means for application to authorize
+ qCWarning(QT_BT_BLUEZ) << "Descriptor write requires authorization."
+ << "The client device needs to be trusted beforehand";
+ return bluezErrorNotAuthorized;
+ }
+
+ if (value.size() > maximumAttributeLength) {
+ qCWarning(QT_BT_BLUEZ) << "Descriptor value is too large:" << value.size();
+ return bluezErrorInvalidValueLength;
+ }
+ m_value = value;
+ emit valueUpdatedByRemote(m_characteristicHandle, handle, value);
+ return {};
+}
+
+// This function is called when the value has been updated locally (server-side)
+bool QtBluezPeripheralDescriptor::localValueUpdate(const QByteArray& value)
+{
+ if (value.size() > maximumAttributeLength) {
+ qCWarning(QT_BT_BLUEZ) << "Descriptor value is too large:" << value.size();
+ return false;
+ }
+ m_value = value;
+ return true;
+}
+
+void QtBluezPeripheralDescriptor::initializeFlags(const QLowEnergyDescriptorData& data)
+{
+ // Flag tokens are from org.bluez.GattDescriptor1 documentation
+ if (data.isReadable())
+ m_flags.append("read"_L1);
+ if (data.readConstraints() & QBluetooth::AttAccessConstraint::AttEncryptionRequired)
+ m_flags.append("encrypt-read"_L1);
+ if (data.readConstraints() & QBluetooth::AttAccessConstraint::AttAuthenticationRequired)
+ m_flags.append("encrypt-authenticated-read"_L1);
+
+ if (data.isWritable())
+ m_flags.append("write"_L1);
+ if (data.writeConstraints() & QBluetooth::AttAccessConstraint::AttEncryptionRequired)
+ m_flags.append("encrypt-write"_L1);
+ if (data.writeConstraints() & QBluetooth::AttAccessConstraint::AttAuthenticationRequired)
+ m_flags.append("encrypt-authenticated-write"_L1);
+
+ if (data.readConstraints() & QBluetooth::AttAccessConstraint::AttAuthorizationRequired
+ || data.writeConstraints() & QBluetooth::AttAccessConstraint::AttAuthorizationRequired)
+ m_flags.append("authorize"_L1);
+
+ if (m_flags.isEmpty()) {
+ qCWarning(QT_BT_BLUEZ) << "Descriptor property flags not set" << uuid
+ << "Peripheral may fail to register";
+ }
+}
+
+QtBluezPeripheralCharacteristic::QtBluezPeripheralCharacteristic(
+ const QLowEnergyCharacteristicData& characteristicData,
+ const QString& servicePath, quint16 ordinal,
+ QLowEnergyHandle handle, QObject* parent)
+ : QtBluezPeripheralGattObject(characteristicPathTemplate.arg(servicePath).arg(ordinal),
+ characteristicData.uuid().toString(QUuid::WithoutBraces), handle, parent),
+ m_adaptor(new OrgBluezGattCharacteristic1Adaptor(this)),
+ m_servicePath(servicePath),
+ m_minimumValueLength(std::min(characteristicData.minimumValueLength(),
+ maximumAttributeLength)),
+ m_maximumValueLength(std::min(characteristicData.maximumValueLength(),
+ maximumAttributeLength))
+{
+ initializeFlags(characteristicData);
+ initializeValue(characteristicData.value());
+}
+
+InterfaceList QtBluezPeripheralCharacteristic::properties() const
+{
+ InterfaceList properties;
+ properties.insert(bluezCharacteristicInterface,
+ {
+ {"UUID"_L1, uuid},
+ {"Service"_L1, QDBusObjectPath(m_servicePath)},
+ {"Flags"_L1, m_flags}
+ });
+ return properties;
+}
+
+// org.bluez.GattCharacteristic1
+// This function is invoked when remote device reads the value
+QByteArray QtBluezPeripheralCharacteristic::ReadValue(const QVariantMap &options, QString& error)
+{
+ accessEvent(options);
+ // Offset is set by Bluez when the value size is more than MTU size.
+ // Bluez deduces the value size from the first ReadValue. If the
+ // received data size is larger than MTU, Bluez will take the first MTU bytes and
+ // issue more ReadValue calls with the 'offset' set
+ const quint16 offset = options.value("offset"_L1).toUInt();
+ const quint16 mtu = options.value("mtu"_L1).toUInt();
+
+ if (offset > m_value.length() - 1) {
+ qCWarning(QT_BT_BLUEZ) << "Invalid offset" << offset << ", value len:" << m_value.length();
+ error = bluezErrorInvalidOffset;
+ return {};
+ }
+
+ if (offset > 0)
+ return m_value.mid(offset, mtu);
+ else
+ return m_value;
+}
+
+// org.bluez.GattCharacteristic1
+// This function is invoked when remote device writes a value
+QString QtBluezPeripheralCharacteristic::WriteValue(const QByteArray &value,
+ const QVariantMap &options)
+{
+ accessEvent(options);
+
+ if (options.value("prepare-authorize"_L1).toBool()) {
+ // Qt API doesn't provide the means for application to authorize
+ qCWarning(QT_BT_BLUEZ) << "Characteristic write requires authorization."
+ << "The client device needs to be trusted beforehand";
+ return bluezErrorNotAuthorized;
+ }
+
+ if (value.size() < m_minimumValueLength || value.size() > m_maximumValueLength) {
+ qCWarning(QT_BT_BLUEZ) << "Characteristic value has invalid length" << value.size()
+ << "min:" << m_minimumValueLength
+ << "max:" << m_maximumValueLength;
+ return bluezErrorInvalidValueLength;
+ }
+ m_value = value;
+ emit valueUpdatedByRemote(handle, value);
+ return {};
+}
+
+// This function is called when the value has been updated locally (server-side)
+bool QtBluezPeripheralCharacteristic::localValueUpdate(const QByteArray& value)
+{
+ if (value.size() < m_minimumValueLength || value.size() > m_maximumValueLength) {
+ qCWarning(QT_BT_BLUEZ) << "Characteristic value has invalid length" << value.size()
+ << "min:" << m_minimumValueLength
+ << "max:" << m_maximumValueLength;
+ return false;
+ }
+ m_value = value;
+ if (m_notifying) {
+ emit propertiesAdaptor->PropertiesChanged(
+ bluezCharacteristicInterface, {{"Value"_L1, m_value}}, {});
+ }
+ return true;
+}
+
+// org.bluez.GattCharacteristic1
+// These are called when remote client enables or disables NTF/IND
+void QtBluezPeripheralCharacteristic::StartNotify()
+{
+ qCDebug(QT_BT_BLUEZ) << "NTF or IND enabled for characteristic" << uuid;
+ m_notifying = true;
+}
+
+void QtBluezPeripheralCharacteristic::StopNotify()
+{
+ qCDebug(QT_BT_BLUEZ) << "NTF or IND disabled for characteristic" << uuid;
+ m_notifying = false;
+}
+
+
+void QtBluezPeripheralCharacteristic::initializeValue(const QByteArray& value)
+{
+ const auto valueSize = value.size();
+ if (valueSize < m_minimumValueLength || valueSize > m_maximumValueLength) {
+ qCWarning(QT_BT_BLUEZ) << "Characteristic value has invalid length" << valueSize
+ << "min:" << m_minimumValueLength
+ << "max:" << m_maximumValueLength;
+ m_value = QByteArray(m_minimumValueLength, 0);
+ } else {
+ m_value = value;
+ }
+}
+
+void QtBluezPeripheralCharacteristic::initializeFlags(const QLowEnergyCharacteristicData& data)
+{
+ // Flag tokens are from org.bluez.GattCharacteristic1 documentation
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::Broadcasting)
+ m_flags.append("broadcast"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::WriteNoResponse)
+ m_flags.append("write-without-response"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::Read)
+ m_flags.append("read"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::Write)
+ m_flags.append("write"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::Notify)
+ m_flags.append("notify"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::Indicate)
+ m_flags.append("indicate"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::WriteSigned)
+ m_flags.append("authenticated-signed-writes"_L1);
+ if (data.properties() & QLowEnergyCharacteristic::PropertyType::ExtendedProperty) {
+ // If extended properties property is set, check if we have the descriptor
+ // describing them. Bluez will generate the actual descriptor based on these
+ // flags. For clarity: the 'extended-properties' token mentioned in the Bluez
+ // API is implied by these flags.
+ for (const auto& descriptor : data.descriptors()) {
+ // Core Bluetooth v5.3 Vol 3, Part G, 3.3.3.1
+ if (descriptor.uuid()
+ == QBluetoothUuid::DescriptorType::CharacteristicExtendedProperties
+ && descriptor.value().size() == 2) {
+ const auto properties = descriptor.value().at(0);
+ if (properties & 0x01)
+ m_flags.append("reliable-write"_L1);
+ if (properties & 0x02)
+ m_flags.append("writable-auxiliaries"_L1);
+ }
+ }
+ }
+
+ if (data.readConstraints() & QBluetooth::AttAccessConstraint::AttEncryptionRequired)
+ m_flags.append("encrypt-read"_L1);
+ if (data.readConstraints() & QBluetooth::AttAccessConstraint::AttAuthenticationRequired)
+ m_flags.append("encrypt-authenticated-read"_L1);
+ if (data.writeConstraints() & QBluetooth::AttAccessConstraint::AttEncryptionRequired)
+ m_flags.append("encrypt-write"_L1);
+ if (data.writeConstraints() & QBluetooth::AttAccessConstraint::AttAuthenticationRequired)
+ m_flags.append("encrypt-authenticated-write"_L1);
+
+ if (data.readConstraints() & QBluetooth::AttAccessConstraint::AttAuthorizationRequired
+ || data.writeConstraints() & QBluetooth::AttAccessConstraint::AttAuthorizationRequired)
+ m_flags.append("authorize"_L1);
+
+ if (m_flags.isEmpty()) {
+ qCWarning(QT_BT_BLUEZ) << "Characteristic property flags not set" << uuid
+ << "Peripheral may fail to register";
+ }
+}
+
+
+QtBluezPeripheralService::QtBluezPeripheralService(const QLowEnergyServiceData &serviceData,
+ const QString& applicationPath, quint16 ordinal,
+ QLowEnergyHandle handle, QObject* parent)
+ : QtBluezPeripheralGattObject(servicePathTemplate.arg(applicationPath).arg(ordinal),
+ serviceData.uuid().toString(QUuid::WithoutBraces), handle, parent),
+ m_isPrimary(serviceData.type() == QLowEnergyServiceData::ServiceTypePrimary),
+ m_adaptor(new OrgBluezGattService1Adaptor(this))
+{
+}
+
+void QtBluezPeripheralService::addIncludedService(const QString& objectPath) {
+ qCDebug(QT_BT_BLUEZ) << "Adding included service" << objectPath << "for" << uuid;
+ m_includedServices.append(QDBusObjectPath(objectPath));
+}
+
+InterfaceList QtBluezPeripheralService::properties() const {
+ InterfaceList interfaces;
+ interfaces.insert(bluezServiceInterface,{
+ {"UUID"_L1, uuid},
+ {"Primary"_L1, m_isPrimary},
+ {"Includes"_L1, QVariant::fromValue(m_includedServices)}
+ });
+ return interfaces;
+};
+
+QT_END_NAMESPACE
+
+#include "moc_bluezperipheralobjects_p.cpp"
diff --git a/src/bluetooth/bluez/bluezperipheralobjects_p.h b/src/bluetooth/bluez/bluezperipheralobjects_p.h
new file mode 100644
index 00000000..dbc9c4eb
--- /dev/null
+++ b/src/bluetooth/bluez/bluezperipheralobjects_p.h
@@ -0,0 +1,171 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef BLUEZ_PERIPHERAL_OBJECTS_P_H
+#define BLUEZ_PERIPHERAL_OBJECTS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "bluez5_helper_p.h"
+
+#include <QtBluetooth/qbluetooth.h>
+#include <QtBluetooth/QBluetoothUuid>
+#include <QtBluetooth/QLowEnergyDescriptorData>
+#include <QtBluetooth/QLowEnergyCharacteristicData>
+#include <QtBluetooth/QLowEnergyServiceData>
+
+class OrgFreedesktopDBusPropertiesAdaptor;
+class OrgBluezGattCharacteristic1Adaptor;
+class OrgBluezGattDescriptor1Adaptor;
+class OrgBluezGattService1Adaptor;
+
+QT_BEGIN_NAMESPACE
+
+// The QtBluezPeripheralGattObject is the base class for services, characteristics, and descriptors
+class QtBluezPeripheralGattObject : public QObject
+{
+ Q_OBJECT
+
+public:
+ QtBluezPeripheralGattObject(const QString& objectPath, const QString& uuid,
+ QLowEnergyHandle handle, QObject* parent = nullptr);
+ virtual ~QtBluezPeripheralGattObject();
+
+ // List of properties exposed by this object, used when Bluez inquiries details
+ virtual InterfaceList properties() const = 0;
+
+ bool registerObject();
+ void unregisterObject();
+
+public:
+ // DBus object path
+ QString objectPath;
+ // UUID of the gatt object
+ QString uuid;
+ // QtBluetooth internal handle and reference to the application
+ // to read and write values towards the Qt API
+ QLowEnergyHandle handle;
+ // Bluez DBus Gatt objects need to provide this
+ OrgFreedesktopDBusPropertiesAdaptor* propertiesAdaptor{};
+
+signals:
+ void remoteDeviceAccessEvent(const QString& remoteDeviceObjectPath, quint16 mtu);
+
+protected:
+ void accessEvent(const QVariantMap& options);
+
+private:
+ bool m_registered = false;
+};
+
+class QtBluezPeripheralDescriptor : public QtBluezPeripheralGattObject
+{
+ Q_OBJECT
+
+public:
+ QtBluezPeripheralDescriptor(const QLowEnergyDescriptorData& descriptorData,
+ const QString& characteristicPath, quint16 ordinal,
+ QLowEnergyHandle handle, QLowEnergyHandle characteristicHandle,
+ QObject* parent);
+
+ InterfaceList properties() const final;
+
+ // org.bluez.GattDescriptor1
+ // This function is invoked when remote device reads the value. Sets error if any
+ Q_INVOKABLE QByteArray ReadValue(const QVariantMap &options, QString &error);
+
+ // org.bluez.GattDescriptor1
+ // This function is invoked when remote device writes a value. Returns Bluez DBus error if any
+ Q_INVOKABLE QString WriteValue(const QByteArray &value, const QVariantMap &options);
+
+ // Call this function when value has been updated locally (server/user application side)
+ bool localValueUpdate(const QByteArray& value);
+
+signals:
+ void valueUpdatedByRemote(QLowEnergyHandle characteristicHandle,
+ QLowEnergyHandle descriptorHandle, const QByteArray& value);
+
+private:
+ void initializeFlags(const QLowEnergyDescriptorData& data);
+
+ OrgBluezGattDescriptor1Adaptor* m_adaptor{};
+ QString m_characteristicPath;
+ QByteArray m_value;
+ QStringList m_flags;
+ QLowEnergyHandle m_characteristicHandle;
+};
+
+
+class QtBluezPeripheralCharacteristic : public QtBluezPeripheralGattObject
+{
+ Q_OBJECT
+
+public:
+ QtBluezPeripheralCharacteristic(const QLowEnergyCharacteristicData& characteristicData,
+ const QString& servicePath, quint16 ordinal,
+ QLowEnergyHandle handle, QObject* parent);
+
+ InterfaceList properties() const final;
+
+ // org.bluez.GattCharacteristic1
+ // This function is invoked when remote device reads the value. Sets error if any
+ Q_INVOKABLE QByteArray ReadValue(const QVariantMap &options, QString& error);
+
+ // org.bluez.GattCharacteristic1
+ // This function is invoked when remote device writes a value. Returns Bluez DBus error if any
+ Q_INVOKABLE QString WriteValue(const QByteArray &value, const QVariantMap &options);
+
+ // org.bluez.GattCharacteristic1
+ // These are called when remote client enables or disables NTF/IND
+ Q_INVOKABLE void StartNotify();
+ Q_INVOKABLE void StopNotify();
+
+ // Call this function when value has been updated locally (server/user application side)
+ bool localValueUpdate(const QByteArray& value);
+
+signals:
+ void valueUpdatedByRemote(QLowEnergyHandle handle, const QByteArray& value);
+
+private:
+ void initializeValue(const QByteArray& value);
+ void initializeFlags(const QLowEnergyCharacteristicData& data);
+
+ OrgBluezGattCharacteristic1Adaptor* m_adaptor{};
+ QString m_servicePath;
+ bool m_notifying{false};
+ QByteArray m_value;
+ QStringList m_flags;
+ int m_minimumValueLength;
+ int m_maximumValueLength;
+};
+
+class QtBluezPeripheralService : public QtBluezPeripheralGattObject
+{
+ Q_OBJECT
+public:
+ QtBluezPeripheralService(const QLowEnergyServiceData &serviceData,
+ const QString& applicationPath, quint16 ordinal,
+ QLowEnergyHandle handle, QObject* parent);
+
+ InterfaceList properties() const final;
+ void addIncludedService(const QString& objectPath);
+
+private:
+ const bool m_isPrimary;
+ OrgBluezGattService1Adaptor* m_adaptor{};
+ QList<QDBusObjectPath> m_includedServices;
+};
+
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/bluetooth/bluez/device.cpp b/src/bluetooth/bluez/device.cpp
deleted file mode 100644
index 14b91ad0..00000000
--- a/src/bluetooth/bluez/device.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -i servicemap_p.h -p device_p.h:device.cpp org.bluez.Device.xml org.bluez.Device
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "device_p.h"
-
-/*
- * Implementation of interface class OrgBluezDeviceInterface
- */
-
-OrgBluezDeviceInterface::OrgBluezDeviceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezDeviceInterface::~OrgBluezDeviceInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/device1_bluez5.cpp b/src/bluetooth/bluez/device1_bluez5.cpp
index cd6453ad..1dc644fb 100644
--- a/src/bluetooth/bluez/device1_bluez5.cpp
+++ b/src/bluetooth/bluez/device1_bluez5.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p device1_bluez5_p.h:device1_bluez5.cpp org.bluez.Device1.xml
+ * Command line was: qdbusxml2cpp -i bluez5_helper_p.h -I QtCore/private/qglobal_p.h -p device1_bluez5_p.h:device1_bluez5.cpp org.bluez.Device1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezDevice1Interface::~OrgBluezDevice1Interface()
{
}
+
+#include "moc_device1_bluez5_p.cpp"
diff --git a/src/bluetooth/bluez/device1_bluez5_p.h b/src/bluetooth/bluez/device1_bluez5_p.h
index b9523a56..281ae237 100644
--- a/src/bluetooth/bluez/device1_bluez5_p.h
+++ b/src/bluetooth/bluez/device1_bluez5_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p device1_bluez5_p.h:device1_bluez5.cpp org.bluez.Device1.xml
+ * Command line was: qdbusxml2cpp -i bluez5_helper_p.h -I QtCore/private/qglobal_p.h -p device1_bluez5_p.h:device1_bluez5.cpp org.bluez.Device1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef DEVICE1_BLUEZ5_P_H
#define DEVICE1_BLUEZ5_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -20,6 +31,7 @@
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
#include "bluez5_helper_p.h"
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.Device1
@@ -96,9 +108,9 @@ public:
inline short rSSI() const
{ return qvariant_cast< short >(property("RSSI")); }
- Q_PROPERTY(QVariantMap ServiceData READ serviceData)
- inline QVariantMap serviceData() const
- { return qvariant_cast< QVariantMap >(property("ServiceData")); }
+ Q_PROPERTY(ServiceDataList ServiceData READ serviceData)
+ inline ServiceDataList serviceData() const
+ { return qvariant_cast< ServiceDataList >(property("ServiceData")); }
Q_PROPERTY(bool ServicesResolved READ servicesResolved)
inline bool servicesResolved() const
@@ -162,7 +174,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezDevice1Interface Device1;
+ using Device1 = ::OrgBluezDevice1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/device_p.h b/src/bluetooth/bluez/device_p.h
deleted file mode 100644
index 2e1e39ad..00000000
--- a/src/bluetooth/bluez/device_p.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -i servicemap_p.h -p device_p.h:device.cpp org.bluez.Device.xml org.bluez.Device
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef DEVICE_P_H
-#define DEVICE_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>
-#include "servicemap_p.h"
-
-/*
- * Proxy class for interface org.bluez.Device
- */
-class OrgBluezDeviceInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.Device"; }
-
-public:
- OrgBluezDeviceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezDeviceInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> CancelDiscovery()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("CancelDiscovery"), argumentList);
- }
-
- inline QDBusPendingReply<QDBusObjectPath> CreateNode(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("CreateNode"), argumentList);
- }
-
- inline QDBusPendingReply<> Disconnect()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("Disconnect"), argumentList);
- }
-
- inline QDBusPendingReply<ServiceMap> DiscoverServices(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("DiscoverServices"), argumentList);
- }
-
- inline QDBusPendingReply<QVariantMap> GetProperties()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetProperties"), argumentList);
- }
-
- inline QDBusPendingReply<QList<QDBusObjectPath> > ListNodes()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("ListNodes"), argumentList);
- }
-
- inline QDBusPendingReply<> RemoveNode(const QDBusObjectPath &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("RemoveNode"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProperty(const QString &in0, const QDBusVariant &in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("SetProperty"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void DisconnectRequested();
- void NodeCreated(const QDBusObjectPath &in0);
- void NodeRemoved(const QDBusObjectPath &in0);
- void PropertyChanged(const QString &in0, const QDBusVariant &in1);
-};
-
-namespace org {
- namespace bluez {
- typedef ::OrgBluezDeviceInterface Device;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/gattchar1.cpp b/src/bluetooth/bluez/gattchar1.cpp
index cdb3fc0d..3a358a0b 100644
--- a/src/bluetooth/bluez/gattchar1.cpp
+++ b/src/bluetooth/bluez/gattchar1.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p gattchar1_p.h:gattchar1.cpp org.bluez.GattCharacteristic1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattchar1_p.h:gattchar1.cpp org.bluez.GattCharacteristic1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezGattCharacteristic1Interface::~OrgBluezGattCharacteristic1Interface()
{
}
+
+#include "moc_gattchar1_p.cpp"
diff --git a/src/bluetooth/bluez/gattchar1_p.h b/src/bluetooth/bluez/gattchar1_p.h
index c19e9f58..860002a4 100644
--- a/src/bluetooth/bluez/gattchar1_p.h
+++ b/src/bluetooth/bluez/gattchar1_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p gattchar1_p.h:gattchar1.cpp org.bluez.GattCharacteristic1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattchar1_p.h:gattchar1.cpp org.bluez.GattCharacteristic1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef GATTCHAR1_P_H
#define GATTCHAR1_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.GattCharacteristic1
@@ -87,7 +99,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezGattCharacteristic1Interface GattCharacteristic1;
+ using GattCharacteristic1 = ::OrgBluezGattCharacteristic1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/gattcharacteristic1adaptor.cpp b/src/bluetooth/bluez/gattcharacteristic1adaptor.cpp
new file mode 100644
index 00000000..d6eb0a1c
--- /dev/null
+++ b/src/bluetooth/bluez/gattcharacteristic1adaptor.cpp
@@ -0,0 +1,108 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a gattcharacteristic1adaptor_p.h:gattcharacteristic1adaptor.cpp -c OrgBluezGattCharacteristic1Adaptor -i bluez5_helper_p.h org.bluez.GattCharacteristic1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "gattcharacteristic1adaptor_p.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class OrgBluezGattCharacteristic1Adaptor
+ */
+
+OrgBluezGattCharacteristic1Adaptor::OrgBluezGattCharacteristic1Adaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+OrgBluezGattCharacteristic1Adaptor::~OrgBluezGattCharacteristic1Adaptor()
+{
+ // destructor
+}
+
+QStringList OrgBluezGattCharacteristic1Adaptor::flags() const
+{
+ // get the value of property Flags
+ return qvariant_cast< QStringList >(parent()->property("Flags"));
+}
+
+bool OrgBluezGattCharacteristic1Adaptor::notifying() const
+{
+ // get the value of property Notifying
+ return qvariant_cast< bool >(parent()->property("Notifying"));
+}
+
+QDBusObjectPath OrgBluezGattCharacteristic1Adaptor::service() const
+{
+ // get the value of property Service
+ return qvariant_cast< QDBusObjectPath >(parent()->property("Service"));
+}
+
+QString OrgBluezGattCharacteristic1Adaptor::uUID() const
+{
+ // get the value of property UUID
+ return qvariant_cast< QString >(parent()->property("UUID"));
+}
+
+QByteArray OrgBluezGattCharacteristic1Adaptor::value() const
+{
+ // get the value of property Value
+ return qvariant_cast< QByteArray >(parent()->property("Value"));
+}
+
+QByteArray OrgBluezGattCharacteristic1Adaptor::ReadValue(const QVariantMap &options,
+ const QDBusMessage& msg)
+{
+ // handle method call org.bluez.GattCharacteristic1.ReadValue
+ QByteArray value;
+ QString error;
+ QMetaObject::invokeMethod(parent(), "ReadValue", Q_RETURN_ARG(QByteArray, value),
+ Q_ARG(QVariantMap, options), Q_ARG(QString&, error));
+ if (!error.isEmpty()) {
+ // Reply with error if needed
+ auto reply = msg.createErrorReply(error, {});
+ QDBusConnection::systemBus().send(reply);
+ }
+ return value;
+}
+
+void OrgBluezGattCharacteristic1Adaptor::StartNotify()
+{
+ // handle method call org.bluez.GattCharacteristic1.StartNotify
+ QMetaObject::invokeMethod(parent(), "StartNotify");
+}
+
+void OrgBluezGattCharacteristic1Adaptor::StopNotify()
+{
+ // handle method call org.bluez.GattCharacteristic1.StopNotify
+ QMetaObject::invokeMethod(parent(), "StopNotify");
+}
+
+void OrgBluezGattCharacteristic1Adaptor::WriteValue(const QByteArray &value,
+ const QVariantMap &options,
+ const QDBusMessage& msg)
+{
+ // handle method call org.bluez.GattCharacteristic1.WriteValue
+ QString error;
+ QMetaObject::invokeMethod(parent(), "WriteValue", Q_RETURN_ARG(QString, error),
+ Q_ARG(QByteArray, value), Q_ARG(QVariantMap, options));
+
+ if (!error.isEmpty()) {
+ // Reply with error if needed
+ auto reply = msg.createErrorReply(error, {});
+ QDBusConnection::systemBus().send(reply);
+ }
+}
diff --git a/src/bluetooth/bluez/gattcharacteristic1adaptor_p.h b/src/bluetooth/bluez/gattcharacteristic1adaptor_p.h
new file mode 100644
index 00000000..7f80e8f0
--- /dev/null
+++ b/src/bluetooth/bluez/gattcharacteristic1adaptor_p.h
@@ -0,0 +1,87 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a gattcharacteristic1adaptor_p.h:gattcharacteristic1adaptor.cpp -c OrgBluezGattCharacteristic1Adaptor -i bluez5_helper_p.h org.bluez.GattCharacteristic1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef GATTCHARACTERISTIC1ADAPTOR_P_H
+#define GATTCHARACTERISTIC1ADAPTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "bluez5_helper_p.h"
+#include <QtCore/qcontainerfwd.h>
+
+/*
+ * Adaptor class for interface org.bluez.GattCharacteristic1
+ */
+class OrgBluezGattCharacteristic1Adaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.bluez.GattCharacteristic1")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.bluez.GattCharacteristic1\">\n"
+" <method name=\"ReadValue\">\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"options\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n"
+" <arg direction=\"out\" type=\"ay\" name=\"value\"/>\n"
+" </method>\n"
+" <method name=\"WriteValue\">\n"
+" <arg direction=\"in\" type=\"ay\" name=\"value\"/>\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"options\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName.In1\"/>\n"
+" </method>\n"
+" <method name=\"StartNotify\"/>\n"
+" <method name=\"StopNotify\"/>\n"
+" <property access=\"read\" type=\"s\" name=\"UUID\"/>\n"
+" <property access=\"read\" type=\"o\" name=\"Service\"/>\n"
+" <property access=\"read\" type=\"ay\" name=\"Value\"/>\n"
+" <property access=\"read\" type=\"b\" name=\"Notifying\"/>\n"
+" <property access=\"read\" type=\"as\" name=\"Flags\"/>\n"
+" </interface>\n"
+ "")
+public:
+ OrgBluezGattCharacteristic1Adaptor(QObject *parent);
+ virtual ~OrgBluezGattCharacteristic1Adaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(QStringList Flags READ flags)
+ QStringList flags() const;
+
+ Q_PROPERTY(bool Notifying READ notifying)
+ bool notifying() const;
+
+ Q_PROPERTY(QDBusObjectPath Service READ service)
+ QDBusObjectPath service() const;
+
+ Q_PROPERTY(QString UUID READ uUID)
+ QString uUID() const;
+
+ Q_PROPERTY(QByteArray Value READ value)
+ QByteArray value() const;
+
+public Q_SLOTS: // METHODS
+ QByteArray ReadValue(const QVariantMap &options, const QDBusMessage &msg);
+ void StartNotify();
+ void StopNotify();
+ void WriteValue(const QByteArray &value, const QVariantMap &options, const QDBusMessage& msg);
+Q_SIGNALS: // SIGNALS
+};
+
+#endif
diff --git a/src/bluetooth/bluez/gattdesc1.cpp b/src/bluetooth/bluez/gattdesc1.cpp
index 8447e49b..abe846a3 100644
--- a/src/bluetooth/bluez/gattdesc1.cpp
+++ b/src/bluetooth/bluez/gattdesc1.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p gattdesc1_p.h:gattdesc1.cpp org.bluez.GattDescriptor1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattdesc1_p.h:gattdesc1.cpp org.bluez.GattDescriptor1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezGattDescriptor1Interface::~OrgBluezGattDescriptor1Interface()
{
}
+
+#include "moc_gattdesc1_p.cpp"
diff --git a/src/bluetooth/bluez/gattdesc1_p.h b/src/bluetooth/bluez/gattdesc1_p.h
index 6ade7a42..a054edfa 100644
--- a/src/bluetooth/bluez/gattdesc1_p.h
+++ b/src/bluetooth/bluez/gattdesc1_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p gattdesc1_p.h:gattdesc1.cpp org.bluez.GattDescriptor1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattdesc1_p.h:gattdesc1.cpp org.bluez.GattDescriptor1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef GATTDESC1_P_H
#define GATTDESC1_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.GattDescriptor1
@@ -67,7 +79,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezGattDescriptor1Interface GattDescriptor1;
+ using GattDescriptor1 = ::OrgBluezGattDescriptor1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/gattdescriptor1adaptor.cpp b/src/bluetooth/bluez/gattdescriptor1adaptor.cpp
new file mode 100644
index 00000000..b7177384
--- /dev/null
+++ b/src/bluetooth/bluez/gattdescriptor1adaptor.cpp
@@ -0,0 +1,84 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a gattdescriptor1adaptor_p.h:gattdescriptor1adaptor.cpp -c OrgBluezGattDescriptor1Adaptor -i bluez5_helper_p.h org.bluez.GattDescriptor1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "gattdescriptor1adaptor_p.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class OrgBluezGattDescriptor1Adaptor
+ */
+
+OrgBluezGattDescriptor1Adaptor::OrgBluezGattDescriptor1Adaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+OrgBluezGattDescriptor1Adaptor::~OrgBluezGattDescriptor1Adaptor()
+{
+ // destructor
+}
+
+QDBusObjectPath OrgBluezGattDescriptor1Adaptor::characteristic() const
+{
+ // get the value of property Characteristic
+ return qvariant_cast< QDBusObjectPath >(parent()->property("Characteristic"));
+}
+
+QString OrgBluezGattDescriptor1Adaptor::uUID() const
+{
+ // get the value of property UUID
+ return qvariant_cast< QString >(parent()->property("UUID"));
+}
+
+QByteArray OrgBluezGattDescriptor1Adaptor::value() const
+{
+ // get the value of property Value
+ return qvariant_cast< QByteArray >(parent()->property("Value"));
+}
+
+QByteArray OrgBluezGattDescriptor1Adaptor::ReadValue(const QVariantMap &options,
+ const QDBusMessage& msg)
+{
+ // handle method call org.bluez.GattDescriptor1.ReadValue
+ QByteArray value;
+ QString error;
+ QMetaObject::invokeMethod(parent(), "ReadValue", Q_RETURN_ARG(QByteArray, value),
+ Q_ARG(QVariantMap, options), Q_ARG(QString&, error));
+ if (!error.isEmpty()) {
+ // Reply with error if needed
+ auto reply = msg.createErrorReply(error, {});
+ QDBusConnection::systemBus().send(reply);
+ }
+ return value;
+}
+
+void OrgBluezGattDescriptor1Adaptor::WriteValue(const QByteArray &value,
+ const QVariantMap &options,
+ const QDBusMessage& msg)
+{
+ // handle method call org.bluez.GattDescriptor1.WriteValue
+ QString error;
+ QMetaObject::invokeMethod(parent(), "WriteValue", Q_RETURN_ARG(QString, error),
+ Q_ARG(QByteArray, value), Q_ARG(QVariantMap, options));
+
+ if (!error.isEmpty()) {
+ // Reply with error if needed
+ auto reply = msg.createErrorReply(error, {});
+ QDBusConnection::systemBus().send(reply);
+ }
+}
diff --git a/src/bluetooth/bluez/gattdescriptor1adaptor_p.h b/src/bluetooth/bluez/gattdescriptor1adaptor_p.h
new file mode 100644
index 00000000..a7eacb99
--- /dev/null
+++ b/src/bluetooth/bluez/gattdescriptor1adaptor_p.h
@@ -0,0 +1,75 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a gattdescriptor1adaptor_p.h:gattdescriptor1adaptor.cpp -c OrgBluezGattDescriptor1Adaptor -i bluez5_helper_p.h org.bluez.GattDescriptor1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef GATTDESCRIPTOR1ADAPTOR_P_H
+#define GATTDESCRIPTOR1ADAPTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "bluez5_helper_p.h"
+#include <QtCore/qcontainerfwd.h>
+
+/*
+ * Adaptor class for interface org.bluez.GattDescriptor1
+ */
+class OrgBluezGattDescriptor1Adaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.bluez.GattDescriptor1")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.bluez.GattDescriptor1\">\n"
+" <method name=\"ReadValue\">\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"options\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n"
+" <arg direction=\"out\" type=\"ay\" name=\"value\"/>\n"
+" </method>\n"
+" <method name=\"WriteValue\">\n"
+" <arg direction=\"in\" type=\"ay\" name=\"value\"/>\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"options\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName.In1\"/>\n"
+" </method>\n"
+" <property access=\"read\" type=\"s\" name=\"UUID\"/>\n"
+" <property access=\"read\" type=\"o\" name=\"Characteristic\"/>\n"
+" <property access=\"read\" type=\"ay\" name=\"Value\"/>\n"
+" </interface>\n"
+ "")
+public:
+ OrgBluezGattDescriptor1Adaptor(QObject *parent);
+ virtual ~OrgBluezGattDescriptor1Adaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(QDBusObjectPath Characteristic READ characteristic)
+ QDBusObjectPath characteristic() const;
+
+ Q_PROPERTY(QString UUID READ uUID)
+ QString uUID() const;
+
+ Q_PROPERTY(QByteArray Value READ value)
+ QByteArray value() const;
+
+public Q_SLOTS: // METHODS
+ QByteArray ReadValue(const QVariantMap &options, const QDBusMessage &msg);
+ void WriteValue(const QByteArray &value, const QVariantMap &options, const QDBusMessage& msg);
+Q_SIGNALS: // SIGNALS
+};
+
+#endif
diff --git a/src/bluetooth/bluez/gattmanager1.cpp b/src/bluetooth/bluez/gattmanager1.cpp
new file mode 100644
index 00000000..66558b0e
--- /dev/null
+++ b/src/bluetooth/bluez/gattmanager1.cpp
@@ -0,0 +1,28 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattmanager1_p.h:gattmanager1.cpp org.bluez.GattManager1.xml --moc
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#include "gattmanager1_p.h"
+
+/*
+ * Implementation of interface class OrgBluezGattManager1Interface
+ */
+
+OrgBluezGattManager1Interface::OrgBluezGattManager1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
+ : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
+{
+}
+
+OrgBluezGattManager1Interface::~OrgBluezGattManager1Interface()
+{
+}
+
+
+#include "moc_gattmanager1_p.cpp"
diff --git a/src/bluetooth/bluez/gattmanager1_p.h b/src/bluetooth/bluez/gattmanager1_p.h
new file mode 100644
index 00000000..43f81272
--- /dev/null
+++ b/src/bluetooth/bluez/gattmanager1_p.h
@@ -0,0 +1,73 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattmanager1_p.h:gattmanager1.cpp org.bluez.GattManager1.xml --moc
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#ifndef GATTMANAGER1_P_H
+#define GATTMANAGER1_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
+
+/*
+ * Proxy class for interface org.bluez.GattManager1
+ */
+class OrgBluezGattManager1Interface: public QDBusAbstractInterface
+{
+ Q_OBJECT
+public:
+ static inline const char *staticInterfaceName()
+ { return "org.bluez.GattManager1"; }
+
+public:
+ OrgBluezGattManager1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
+
+ ~OrgBluezGattManager1Interface();
+
+public Q_SLOTS: // METHODS
+ inline QDBusPendingReply<> RegisterApplication(const QDBusObjectPath &application, const QVariantMap &options)
+ {
+ QList<QVariant> argumentList;
+ argumentList << QVariant::fromValue(application) << QVariant::fromValue(options);
+ return asyncCallWithArgumentList(QStringLiteral("RegisterApplication"), argumentList);
+ }
+
+ inline QDBusPendingReply<> UnregisterApplication(const QDBusObjectPath &application)
+ {
+ QList<QVariant> argumentList;
+ argumentList << QVariant::fromValue(application);
+ return asyncCallWithArgumentList(QStringLiteral("UnregisterApplication"), argumentList);
+ }
+
+Q_SIGNALS: // SIGNALS
+};
+
+namespace org {
+ namespace bluez {
+ using GattManager1 = ::OrgBluezGattManager1Interface;
+ }
+}
+#endif
diff --git a/src/bluetooth/bluez/gattservice1.cpp b/src/bluetooth/bluez/gattservice1.cpp
index 0b80ac90..4a490c56 100644
--- a/src/bluetooth/bluez/gattservice1.cpp
+++ b/src/bluetooth/bluez/gattservice1.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p gattservice1_p.h:gattservice1.cpp org.bluez.GattService1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattservice1_p.h:gattservice1.cpp org.bluez.GattService1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezGattService1Interface::~OrgBluezGattService1Interface()
{
}
+
+#include "moc_gattservice1_p.cpp"
diff --git a/src/bluetooth/bluez/gattservice1_p.h b/src/bluetooth/bluez/gattservice1_p.h
index 128305f1..3b2e1194 100644
--- a/src/bluetooth/bluez/gattservice1_p.h
+++ b/src/bluetooth/bluez/gattservice1_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p gattservice1_p.h:gattservice1.cpp org.bluez.GattService1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p gattservice1_p.h:gattservice1.cpp org.bluez.GattService1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef GATTSERVICE1_P_H
#define GATTSERVICE1_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.GattService1
@@ -57,7 +69,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezGattService1Interface GattService1;
+ using GattService1 = ::OrgBluezGattService1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/gattservice1adaptor.cpp b/src/bluetooth/bluez/gattservice1adaptor.cpp
new file mode 100644
index 00000000..365040c3
--- /dev/null
+++ b/src/bluetooth/bluez/gattservice1adaptor.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a gattservice1adaptor_p.h:gattservice1adaptor.cpp -c OrgBluezGattService1Adaptor -i bluez5_helper_p.h org.bluez.GattService1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "gattservice1adaptor_p.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class OrgBluezGattService1Adaptor
+ */
+
+OrgBluezGattService1Adaptor::OrgBluezGattService1Adaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+OrgBluezGattService1Adaptor::~OrgBluezGattService1Adaptor()
+{
+ // destructor
+}
+
+QDBusObjectPath OrgBluezGattService1Adaptor::device() const
+{
+ // get the value of property Device
+ return qvariant_cast< QDBusObjectPath >(parent()->property("Device"));
+}
+
+QList<QDBusObjectPath> OrgBluezGattService1Adaptor::includes() const
+{
+ // get the value of property Includes
+ return qvariant_cast< QList<QDBusObjectPath> >(parent()->property("Includes"));
+}
+
+bool OrgBluezGattService1Adaptor::primary() const
+{
+ // get the value of property Primary
+ return qvariant_cast< bool >(parent()->property("Primary"));
+}
+
+QString OrgBluezGattService1Adaptor::uUID() const
+{
+ // get the value of property UUID
+ return qvariant_cast< QString >(parent()->property("UUID"));
+}
diff --git a/src/bluetooth/bluez/gattservice1adaptor_p.h b/src/bluetooth/bluez/gattservice1adaptor_p.h
new file mode 100644
index 00000000..b9bd85a7
--- /dev/null
+++ b/src/bluetooth/bluez/gattservice1adaptor_p.h
@@ -0,0 +1,67 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a gattservice1adaptor_p.h:gattservice1adaptor.cpp -c OrgBluezGattService1Adaptor -i bluez5_helper_p.h org.bluez.GattService1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef GATTSERVICE1ADAPTOR_P_H
+#define GATTSERVICE1ADAPTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "bluez5_helper_p.h"
+#include <QtCore/qcontainerfwd.h>
+
+/*
+ * Adaptor class for interface org.bluez.GattService1
+ */
+class OrgBluezGattService1Adaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.bluez.GattService1")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.bluez.GattService1\">\n"
+" <property access=\"read\" type=\"s\" name=\"UUID\"/>\n"
+" <property access=\"read\" type=\"o\" name=\"Device\"/>\n"
+" <property access=\"read\" type=\"b\" name=\"Primary\"/>\n"
+" <property access=\"read\" type=\"ao\" name=\"Includes\"/>\n"
+" </interface>\n"
+ "")
+public:
+ OrgBluezGattService1Adaptor(QObject *parent);
+ virtual ~OrgBluezGattService1Adaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(QDBusObjectPath Device READ device)
+ QDBusObjectPath device() const;
+
+ Q_PROPERTY(QList<QDBusObjectPath> Includes READ includes)
+ QList<QDBusObjectPath> includes() const;
+
+ Q_PROPERTY(bool Primary READ primary)
+ bool primary() const;
+
+ Q_PROPERTY(QString UUID READ uUID)
+ QString uUID() const;
+
+public Q_SLOTS: // METHODS
+Q_SIGNALS: // SIGNALS
+};
+
+#endif
diff --git a/src/bluetooth/bluez/generate b/src/bluetooth/bluez/generate
index b3db63ff..f009f232 100755
--- a/src/bluetooth/bluez/generate
+++ b/src/bluetooth/bluez/generate
@@ -1,28 +1,31 @@
#!/bin/sh
-#Bluez 4
-qdbusxml2cpp -p manager_p.h:manager.cpp org.bluez.Manager.xml org.bluez.Manager
-qdbusxml2cpp -p adapter_p.h:adapter.cpp org.bluez.all.xml org.bluez.Adapter
-qdbusxml2cpp -i servicemap_p.h -p device_p.h:device.cpp org.bluez.Device.xml org.bluez.Device
-qdbusxml2cpp -p service_p.h:service.cpp org.bluez.all.xml org.bluez.Service
-qdbusxml2cpp -c OrgBluezAgentAdaptor -a agent_p.h:agent.cpp org.bluez.Agent.xml org.bluez.Agent
-qdbusxml2cpp -p obex_manager_p.h:obex_manager.cpp org.openobex.all.xml org.openobex.Manager
-qdbusxml2cpp -p obex_client_p.h:obex_client.cpp org.openobex.client.xml org.openobex.Client
-qdbusxml2cpp -p obex_transfer_p.h:obex_transfer.cpp org.openobex.transfer.xml org.openobex.Transfer
-qdbusxml2cpp -a obex_agent_p.h:obex_agent.cpp org.openobex.agent.xml org.openobex.Agent
+QGLOBAL_P_H=QtCore/private/qglobal_p.h
+
+process() {
+ CPP_BASENAME=$1
+ shift
+ XML_FILE="$1"
+ shift
+
+ HEADER_FILE=${CPP_BASENAME}_p.h
+ CPP_FILE=${CPP_BASENAME}.cpp
+ qdbusxml2cpp "$@" -I "$QGLOBAL_P_H" -p $HEADER_FILE:$CPP_FILE "$XML_FILE" --moc
+}
#Bluez 5
-qdbusxml2cpp -p adapter1_bluez5_p.h:adapter1_bluez5.cpp org.bluez.Adapter1.xml
-qdbusxml2cpp -i bluez5_helper_p.h -p device1_bluez5_p.h:device1_bluez5.cpp org.bluez.Device1.xml
-qdbusxml2cpp -p profilemanager1_p.h:profilemanager1.cpp org.bluez.ProfileManager1.xml
-qdbusxml2cpp -p profile1_p.h:profile1.cpp org.bluez.Profile1.xml
-qdbusxml2cpp -i bluez5_helper_p.h -p objectmanager_p.h:objectmanager.cpp org.freedesktop.dbus.objectmanager.xml
-qdbusxml2cpp -p properties_p.h:properties.cpp org.freedesktop.dbus.properties.xml
-qdbusxml2cpp -p obex_client1_bluez5_p.h:obex_client1_bluez5_p.h org.bluez.Client1.xml
-qdbusxml2cpp -p obex_objectpush1_bluez5_p.h:obex_objectpush1_bluez5.cpp org.bluez.obex.ObjectPush1.xml
-qdbusxml2cpp -p obex_transfer1_bluez5_p.h:obex_transfer1_bluez5_p.h org.bluez.obex.Transfer1.xml
-qdbusxml2cpp -p gattchar1_p.h:gattchar1.cpp org.bluez.GattCharacteristic1.xml
-qdbusxml2cpp -p gattdesc1_p.h:gattdesc1.cpp org.bluez.GattDescriptor1.xml
-qdbusxml2cpp -p gattservice1_p.h:gattservice1.cpp org.bluez.GattService1.xml
-qdbusxml2cpp -p battery1_p.h:battery1.cpp org.bluez.Battery1.xml
+process adapter1_bluez5 org.bluez.Adapter1.xml
+process device1_bluez5 org.bluez.Device1.xml -i bluez5_helper_p.h
+process profilemanager1 org.bluez.ProfileManager1.xml
+process profile1 org.bluez.Profile1.xml
+
+process objectmanager org.freedesktop.dbus.objectmanager.xml -i bluez5_helper_p.h
+process properties org.freedesktop.dbus.properties.xml
+
+process gattchar1 org.bluez.GattCharacteristic1.xml
+process gattdesc1 org.bluez.GattDescriptor1.xml
+process gattservice1 org.bluez.GattService1.xml
+process battery1 org.bluez.Battery1.xml
+process gattmanager1 org.bluez.GattManager1.xml
+process leadvertisingmanager1 org.bluez.LEAdvertisingManager1.xml
diff --git a/src/bluetooth/bluez/hcimanager.cpp b/src/bluetooth/bluez/hcimanager.cpp
index 845dfec0..573d603c 100644
--- a/src/bluetooth/bluez/hcimanager.cpp
+++ b/src/bluetooth/bluez/hcimanager.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Javier S. Pedro <maemo@javispedro.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2016 Javier S. Pedro <maemo@javispedro.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "hcimanager_p.h"
@@ -57,8 +21,8 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ)
-HciManager::HciManager(const QBluetoothAddress& deviceAdapter, QObject *parent) :
- QObject(parent), hciSocket(-1), hciDev(-1)
+HciManager::HciManager(const QBluetoothAddress& deviceAdapter) :
+ QObject(nullptr), hciSocket(-1), hciDev(-1)
{
hciSocket = ::socket(AF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC, BTPROTO_HCI);
if (hciSocket < 0) {
@@ -88,7 +52,7 @@ HciManager::HciManager(const QBluetoothAddress& deviceAdapter, QObject *parent)
}
notifier = new QSocketNotifier(hciSocket, QSocketNotifier::Read, this);
- connect(notifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify()));
+ connect(notifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_readNotify()));
}
@@ -168,7 +132,7 @@ bool HciManager::monitorEvent(HciManager::HciEvent event)
}
hci_filter_set_ptype(HCI_EVENT_PKT, &filter);
- hci_filter_set_event(event, &filter);
+ hci_filter_set_event(static_cast<int>(event), &filter);
//hci_filter_all_events(&filter);
if (setsockopt(hciSocket, SOL_HCI, HCI_FILTER, &filter, sizeof(hci_filter)) < 0) {
@@ -202,13 +166,13 @@ bool HciManager::monitorAclPackets()
return true;
}
-bool HciManager::sendCommand(OpCodeGroupField ogf, OpCodeCommandField ocf, const QByteArray &parameters)
+bool HciManager::sendCommand(QBluezConst::OpCodeGroupField ogf, QBluezConst::OpCodeCommandField ocf, const QByteArray &parameters)
{
qCDebug(QT_BT_BLUEZ) << "sending command; ogf:" << ogf << "ocf:" << ocf;
quint8 packetType = HCI_COMMAND_PKT;
hci_command_hdr command = {
opCodePack(ogf, ocf),
- static_cast<uint8_t>(parameters.count())
+ static_cast<uint8_t>(parameters.size())
};
static_assert(sizeof command == 3, "unexpected struct size");
struct iovec iv[3];
@@ -219,7 +183,7 @@ bool HciManager::sendCommand(OpCodeGroupField ogf, OpCodeCommandField ocf, const
int ivn = 2;
if (!parameters.isEmpty()) {
iv[2].iov_base = const_cast<char *>(parameters.constData()); // const_cast is safe, since iov_base will not get modified.
- iv[2].iov_len = parameters.count();
+ iv[2].iov_len = parameters.size();
++ivn;
}
while (writev(hciSocket, iv, ivn) < 0) {
@@ -284,10 +248,10 @@ QBluetoothAddress HciManager::addressForConnectionHandle(quint16 handle) const
return QBluetoothAddress();
}
-QVector<quint16> HciManager::activeLowEnergyConnections() const
+QList<quint16> HciManager::activeLowEnergyConnections() const
{
if (!isValid())
- return QVector<quint16>();
+ return QList<quint16>();
hci_conn_info *info;
hci_conn_list_req *infoList;
@@ -297,7 +261,7 @@ QVector<quint16> HciManager::activeLowEnergyConnections() const
malloc(sizeof(hci_conn_list_req) + maxNoOfConnections * sizeof(hci_conn_info));
if (!infoList)
- return QVector<quint16>();
+ return QList<quint16>();
QScopedPointer<hci_conn_list_req, QScopedPointerPodDeleter> p(infoList);
p->conn_num = maxNoOfConnections;
@@ -306,10 +270,10 @@ QVector<quint16> HciManager::activeLowEnergyConnections() const
if (ioctl(hciSocket, HCIGETCONNLIST, (void *) infoList) < 0) {
qCWarning(QT_BT_BLUEZ) << "Cannot retrieve connection list";
- return QVector<quint16>();
+ return QList<quint16>();
}
- QVector<quint16> activeLowEnergyHandles;
+ QList<quint16> activeLowEnergyHandles;
for (int i = 0; i < infoList->conn_num; i++) {
switch (info[i].type) {
case SCO_LINK:
@@ -369,7 +333,7 @@ bool HciManager::sendConnectionUpdateCommand(quint16 handle,
commandParams.maxCeLength = qToLittleEndian(quint16(0xffff));
const QByteArray data = QByteArray::fromRawData(reinterpret_cast<char *>(&commandParams),
sizeof commandParams);
- return sendCommand(OgfLinkControl, OcfLeConnectionUpdate, data);
+ return sendCommand(QBluezConst::OgfLinkControl, QBluezConst::OcfLeConnectionUpdate, data);
}
bool HciManager::sendConnectionParameterUpdateRequest(quint16 handle,
@@ -428,9 +392,8 @@ bool HciManager::sendConnectionParameterUpdateRequest(quint16 handle,
void HciManager::_q_readNotify()
{
unsigned char buffer[qMax<int>(HCI_MAX_EVENT_SIZE, sizeof(AclData))];
- int size;
- size = ::read(hciSocket, buffer, sizeof(buffer));
+ const auto size = ::read(hciSocket, buffer, sizeof(buffer));
if (size < 0) {
if (errno != EAGAIN && errno != EINTR)
qCWarning(QT_BT_BLUEZ) << "Failed reading HCI events:" << qt_error_string(errno);
@@ -467,11 +430,11 @@ void HciManager::handleHciEventPacket(const quint8 *data, int size)
return;
}
- qCDebug(QT_BT_BLUEZ) << "HCI event triggered, type:" << Qt::hex << header->evt;
+ qCDebug(QT_BT_BLUEZ) << "HCI event triggered, type:" << (HciManager::HciEvent)header->evt
+ << "type code:" << Qt::hex << header->evt;
- switch (header->evt) {
- case EVT_ENCRYPT_CHANGE:
- {
+ switch ((HciManager::HciEvent)header->evt) {
+ case HciEvent::EVT_ENCRYPT_CHANGE: {
const evt_encrypt_change *event = (evt_encrypt_change *) data;
qCDebug(QT_BT_BLUEZ) << "HCI Encrypt change, status:"
<< (event->status == 0 ? "Success" : "Failed")
@@ -481,9 +444,8 @@ void HciManager::handleHciEventPacket(const quint8 *data, int size)
QBluetoothAddress remoteDevice = addressForConnectionHandle(event->handle);
if (!remoteDevice.isNull())
emit encryptionChangedEvent(remoteDevice, event->status == 0);
- }
- break;
- case EVT_CMD_COMPLETE: {
+ } break;
+ case HciEvent::EVT_CMD_COMPLETE: {
auto * const event = reinterpret_cast<const evt_cmd_complete *>(data);
static_assert(sizeof *event == 3, "unexpected struct size");
@@ -493,9 +455,8 @@ void HciManager::handleHciEventPacket(const quint8 *data, int size)
const auto additionalData = QByteArray(reinterpret_cast<const char *>(data)
+ sizeof *event + 1, size - sizeof *event - 1);
emit commandCompleted(event->opcode, status, additionalData);
- }
- break;
- case LeMetaEvent:
+ } break;
+ case HciEvent::EVT_LE_META_EVENT:
handleLeMetaEvent(data);
break;
default:
@@ -555,7 +516,7 @@ void HciManager::handleHciAclPacket(const quint8 *data, int size)
qCWarning(QT_BT_BLUEZ) << "Unexpected key size" << size << "in Signing Information packet";
return;
}
- quint128 csrk;
+ BluezUint128 csrk;
memcpy(&csrk, data + 1, sizeof csrk);
const bool isRemoteKey = aclData->pbFlag == 2;
emit signatureResolvingKeyReceived(aclData->handle, isRemoteKey, csrk);
@@ -563,9 +524,11 @@ void HciManager::handleHciAclPacket(const quint8 *data, int size)
void HciManager::handleLeMetaEvent(const quint8 *data)
{
- // Spec v4.2, Vol 2, part E, 7.7.65ff
+ // Spec v5.3, Vol 4, part E, 7.7.65.*
switch (*data) {
- case 0x1: {
+ case 0x1: // HCI_LE_Connection_Complete
+ case 0xA: // HCI_LE_Enhanced_Connection_Complete
+ {
const quint16 handle = bt_get_le16(data + 2);
emit connectionComplete(handle);
break;
@@ -597,3 +560,5 @@ void HciManager::handleLeMetaEvent(const quint8 *data)
}
QT_END_NAMESPACE
+
+#include "moc_hcimanager_p.cpp"
diff --git a/src/bluetooth/bluez/hcimanager_p.h b/src/bluetooth/bluez/hcimanager_p.h
index 15b8791e..67ed900d 100644
--- a/src/bluetooth/bluez/hcimanager_p.h
+++ b/src/bluetooth/bluez/hcimanager_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef HCIMANAGER_P_H
#define HCIMANAGER_P_H
@@ -51,11 +15,11 @@
// We mean it.
//
-#include <QObject>
+#include <QtCore/QObject>
+#include <QtCore/QList>
#include <QtCore/QSet>
#include <QtCore/QSocketNotifier>
#include <QtBluetooth/QBluetoothAddress>
-#include <QVector>
#include "bluez/bluez_data_p.h"
QT_BEGIN_NAMESPACE
@@ -66,25 +30,145 @@ class HciManager : public QObject
{
Q_OBJECT
public:
- enum HciEvent {
- EncryptChangeEvent = EVT_ENCRYPT_CHANGE,
- CommandCompleteEvent = EVT_CMD_COMPLETE,
- LeMetaEvent = 0x3e,
+ enum class HciEvent {
+ EVT_INQUIRY_COMPLETE = 0x01,
+ EVT_INQUIRY_RESULT = 0x02,
+ EVT_CONN_COMPLETE = 0x03,
+ EVT_CONN_REQUEST = 0x04,
+ EVT_DISCONN_COMPLETE = 0x05,
+ EVT_AUTH_COMPLETE = 0x06,
+ EVT_REMOTE_NAME_REQ_COMPLETE = 0x07,
+ EVT_ENCRYPT_CHANGE = 0x08,
+ EVT_CHANGE_CONN_LINK_KEY_COMPLETE = 0x09,
+ EVT_MASTER_LINK_KEY_COMPLETE = 0x0A,
+ EVT_READ_REMOTE_FEATURES_COMPLETE = 0x0B,
+ EVT_READ_REMOTE_VERSION_COMPLETE = 0x0C,
+ EVT_QOS_SETUP_COMPLETE = 0x0D,
+ EVT_CMD_COMPLETE = 0x0E,
+ EVT_CMD_STATUS = 0x0F,
+ EVT_HARDWARE_ERROR = 0x10,
+ EVT_FLUSH_OCCURRED = 0x11,
+ EVT_ROLE_CHANGE = 0x12,
+ EVT_NUM_COMP_PKTS = 0x13,
+ EVT_MODE_CHANGE = 0x14,
+ EVT_RETURN_LINK_KEYS = 0x15,
+ EVT_PIN_CODE_REQ = 0x16,
+ EVT_LINK_KEY_REQ = 0x17,
+ EVT_LINK_KEY_NOTIFY = 0x18,
+ EVT_LOOPBACK_COMMAND = 0x19,
+ EVT_DATA_BUFFER_OVERFLOW = 0x1A,
+ EVT_MAX_SLOTS_CHANGE = 0x1B,
+ EVT_READ_CLOCK_OFFSET_COMPLETE = 0x1C,
+ EVT_CONN_PTYPE_CHANGED = 0x1D,
+ EVT_QOS_VIOLATION = 0x1E,
+ EVT_PSCAN_REP_MODE_CHANGE = 0x20,
+ EVT_FLOW_SPEC_COMPLETE = 0x21,
+ EVT_INQUIRY_RESULT_WITH_RSSI = 0x22,
+ EVT_READ_REMOTE_EXT_FEATURES_COMPLETE = 0x23,
+ EVT_SYNC_CONN_COMPLETE = 0x2C,
+ EVT_SYNC_CONN_CHANGED = 0x2D,
+ EVT_SNIFF_SUBRATING = 0x2E,
+ EVT_EXTENDED_INQUIRY_RESULT = 0x2F,
+ EVT_ENCRYPTION_KEY_REFRESH_COMPLETE = 0x30,
+ EVT_IO_CAPABILITY_REQUEST = 0x31,
+ EVT_IO_CAPABILITY_RESPONSE = 0x32,
+ EVT_USER_CONFIRM_REQUEST = 0x33,
+ EVT_USER_PASSKEY_REQUEST = 0x34,
+ EVT_REMOTE_OOB_DATA_REQUEST = 0x35,
+ EVT_SIMPLE_PAIRING_COMPLETE = 0x36,
+ EVT_LINK_SUPERVISION_TIMEOUT_CHANGED = 0x38,
+ EVT_ENHANCED_FLUSH_COMPLETE = 0x39,
+ EVT_USER_PASSKEY_NOTIFY = 0x3B,
+ EVT_KEYPRESS_NOTIFY = 0x3C,
+ EVT_REMOTE_HOST_FEATURES_NOTIFY = 0x3D,
+ EVT_LE_META_EVENT = 0x3E,
+ EVT_PHYSICAL_LINK_COMPLETE = 0x40,
+ EVT_CHANNEL_SELECTED = 0x41,
+ EVT_DISCONNECT_PHYSICAL_LINK_COMPLETE = 0x42,
+ EVT_PHYSICAL_LINK_LOSS_EARLY_WARNING = 0x43,
+ EVT_PHYSICAL_LINK_RECOVERY = 0x44,
+ EVT_LOGICAL_LINK_COMPLETE = 0x45,
+ EVT_DISCONNECT_LOGICAL_LINK_COMPLETE = 0x46,
+ EVT_FLOW_SPEC_MODIFY_COMPLETE = 0x47,
+ EVT_NUMBER_COMPLETED_BLOCKS = 0x48,
+ EVT_AMP_STATUS_CHANGE = 0x4D,
+ EVT_TESTING = 0xFE,
+ EVT_VENDOR = 0xFF,
+ EVT_STACK_INTERNAL = 0xFD
};
+ Q_ENUM(HciEvent);
+
+ enum class HciError {
+ HCI_SUCCESS = 0x00, // added for convenience, not in bluez code
+ HCI_UNKNOWN_COMMAND = 0x01,
+ HCI_NO_CONNECTION = 0x02,
+ HCI_HARDWARE_FAILURE = 0x03,
+ HCI_PAGE_TIMEOUT = 0x04,
+ HCI_AUTHENTICATION_FAILURE = 0x05,
+ HCI_PIN_OR_KEY_MISSING = 0x06,
+ HCI_MEMORY_FULL = 0x07,
+ HCI_CONNECTION_TIMEOUT = 0x08,
+ HCI_MAX_NUMBER_OF_CONNECTIONS = 0x09,
+ HCI_MAX_NUMBER_OF_SCO_CONNECTIONS = 0x0a,
+ HCI_ACL_CONNECTION_EXISTS = 0x0b,
+ HCI_COMMAND_DISALLOWED = 0x0c,
+ HCI_REJECTED_LIMITED_RESOURCES = 0x0d,
+ HCI_REJECTED_SECURITY = 0x0e,
+ HCI_REJECTED_PERSONAL = 0x0f,
+ HCI_HOST_TIMEOUT = 0x10,
+ HCI_UNSUPPORTED_FEATURE = 0x11,
+ HCI_INVALID_PARAMETERS = 0x12,
+ HCI_OE_USER_ENDED_CONNECTION = 0x13,
+ HCI_OE_LOW_RESOURCES = 0x14,
+ HCI_OE_POWER_OFF = 0x15,
+ HCI_CONNECTION_TERMINATED = 0x16,
+ HCI_REPEATED_ATTEMPTS = 0x17,
+ HCI_PAIRING_NOT_ALLOWED = 0x18,
+ HCI_UNKNOWN_LMP_PDU = 0x19,
+ HCI_UNSUPPORTED_REMOTE_FEATURE = 0x1a,
+ HCI_SCO_OFFSET_REJECTED = 0x1b,
+ HCI_SCO_INTERVAL_REJECTED = 0x1c,
+ HCI_AIR_MODE_REJECTED = 0x1d,
+ HCI_INVALID_LMP_PARAMETERS = 0x1e,
+ HCI_UNSPECIFIED_ERROR = 0x1f,
+ HCI_UNSUPPORTED_LMP_PARAMETER_VALUE = 0x20,
+ HCI_ROLE_CHANGE_NOT_ALLOWED = 0x21,
+ HCI_LMP_RESPONSE_TIMEOUT = 0x22,
+ HCI_LMP_ERROR_TRANSACTION_COLLISION = 0x23,
+ HCI_LMP_PDU_NOT_ALLOWED = 0x24,
+ HCI_ENCRYPTION_MODE_NOT_ACCEPTED = 0x25,
+ HCI_UNIT_LINK_KEY_USED = 0x26,
+ HCI_QOS_NOT_SUPPORTED = 0x27,
+ HCI_INSTANT_PASSED = 0x28,
+ HCI_PAIRING_NOT_SUPPORTED = 0x29,
+ HCI_TRANSACTION_COLLISION = 0x2a,
+ HCI_QOS_UNACCEPTABLE_PARAMETER = 0x2c,
+ HCI_QOS_REJECTED = 0x2d,
+ HCI_CLASSIFICATION_NOT_SUPPORTED = 0x2e,
+ HCI_INSUFFICIENT_SECURITY = 0x2f,
+ HCI_PARAMETER_OUT_OF_RANGE = 0x30,
+ HCI_ROLE_SWITCH_PENDING = 0x32,
+ HCI_SLOT_VIOLATION = 0x34,
+ HCI_ROLE_SWITCH_FAILED = 0x35,
+ HCI_EIR_TOO_LARGE = 0x36,
+ HCI_SIMPLE_PAIRING_NOT_SUPPORTED = 0x37,
+ HCI_HOST_BUSY_PAIRING = 0x38
+ };
+ Q_ENUM(HciError);
- explicit HciManager(const QBluetoothAddress &deviceAdapter, QObject *parent = nullptr);
+ explicit HciManager(const QBluetoothAddress &deviceAdapter);
~HciManager();
bool isValid() const;
bool monitorEvent(HciManager::HciEvent event);
bool monitorAclPackets();
- bool sendCommand(OpCodeGroupField ogf, OpCodeCommandField ocf, const QByteArray &parameters);
+ bool sendCommand(QBluezConst::OpCodeGroupField ogf, QBluezConst::OpCodeCommandField ocf, const QByteArray &parameters);
void stopEvents();
QBluetoothAddress addressForConnectionHandle(quint16 handle) const;
// active connections
- QVector<quint16> activeLowEnergyConnections() const;
+ QList<quint16> activeLowEnergyConnections() const;
bool sendConnectionUpdateCommand(quint16 handle, const QLowEnergyConnectionParameters &params);
bool sendConnectionParameterUpdateRequest(quint16 handle,
@@ -95,7 +179,7 @@ signals:
void commandCompleted(quint16 opCode, quint8 status, const QByteArray &data);
void connectionComplete(quint16 handle);
void connectionUpdate(quint16 handle, const QLowEnergyConnectionParameters &parameters);
- void signatureResolvingKeyReceived(quint16 connHandle, bool remoteKey, const quint128 &csrk);
+ void signatureResolvingKeyReceived(quint16 connHandle, bool remoteKey, BluezUint128 csrk);
private slots:
void _q_readNotify();
diff --git a/src/bluetooth/bluez/leadvertisement1.cpp b/src/bluetooth/bluez/leadvertisement1.cpp
new file mode 100644
index 00000000..e1b91c4a
--- /dev/null
+++ b/src/bluetooth/bluez/leadvertisement1.cpp
@@ -0,0 +1,136 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a leadvertisement1_p.h:leadvertisement1.cpp -c OrgBluezLEAdvertisement1Adaptor -i bluez5_helper_p.h org.bluez.LEAdvertisement1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "leadvertisement1_p.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class OrgBluezLEAdvertisement1Adaptor
+ */
+
+OrgBluezLEAdvertisement1Adaptor::OrgBluezLEAdvertisement1Adaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+OrgBluezLEAdvertisement1Adaptor::~OrgBluezLEAdvertisement1Adaptor()
+{
+ // destructor
+}
+
+bool OrgBluezLEAdvertisement1Adaptor::discoverable() const
+{
+ // get the value of property Discoverable
+ return qvariant_cast< bool >(parent()->property("Discoverable"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setDiscoverable(bool value)
+{
+ // set the value of property Discoverable
+ parent()->setProperty("Discoverable", QVariant::fromValue(value));
+}
+
+QStringList OrgBluezLEAdvertisement1Adaptor::includes() const
+{
+ // get the value of property Includes
+ return qvariant_cast< QStringList >(parent()->property("Includes"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setIncludes(const QStringList &value)
+{
+ // set the value of property Includes
+ parent()->setProperty("Includes", QVariant::fromValue(value));
+}
+
+QString OrgBluezLEAdvertisement1Adaptor::localName() const
+{
+ // get the value of property LocalName
+ return qvariant_cast< QString >(parent()->property("LocalName"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setLocalName(const QString &value)
+{
+ // set the value of property LocalName
+ parent()->setProperty("LocalName", QVariant::fromValue(value));
+}
+
+ManufacturerDataList OrgBluezLEAdvertisement1Adaptor::manufacturerData() const
+{
+ // get the value of property ManufacturerData
+ return qvariant_cast< ManufacturerDataList >(parent()->property("ManufacturerData"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setManufacturerData(ManufacturerDataList value)
+{
+ // set the value of property ManufacturerData
+ parent()->setProperty("ManufacturerData", QVariant::fromValue(value));
+}
+
+uint OrgBluezLEAdvertisement1Adaptor::maxInterval() const
+{
+ // get the value of property MaxInterval
+ return qvariant_cast< uint >(parent()->property("MaxInterval"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setMaxInterval(uint value)
+{
+ // set the value of property MaxInterval
+ parent()->setProperty("MaxInterval", QVariant::fromValue(value));
+}
+
+uint OrgBluezLEAdvertisement1Adaptor::minInterval() const
+{
+ // get the value of property MinInterval
+ return qvariant_cast< uint >(parent()->property("MinInterval"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setMinInterval(uint value)
+{
+ // set the value of property MinInterval
+ parent()->setProperty("MinInterval", QVariant::fromValue(value));
+}
+
+QStringList OrgBluezLEAdvertisement1Adaptor::serviceUUIDs() const
+{
+ // get the value of property ServiceUUIDs
+ return qvariant_cast< QStringList >(parent()->property("ServiceUUIDs"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setServiceUUIDs(const QStringList &value)
+{
+ // set the value of property ServiceUUIDs
+ parent()->setProperty("ServiceUUIDs", QVariant::fromValue(value));
+}
+
+QString OrgBluezLEAdvertisement1Adaptor::type() const
+{
+ // get the value of property Type
+ return qvariant_cast< QString >(parent()->property("Type"));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::setType(const QString &value)
+{
+ // set the value of property Type
+ parent()->setProperty("Type", QVariant::fromValue(value));
+}
+
+void OrgBluezLEAdvertisement1Adaptor::Release()
+{
+ // handle method call org.bluez.LEAdvertisement1.Release
+ QMetaObject::invokeMethod(parent(), "Release");
+}
diff --git a/src/bluetooth/bluez/leadvertisement1_p.h b/src/bluetooth/bluez/leadvertisement1_p.h
new file mode 100644
index 00000000..8931e43c
--- /dev/null
+++ b/src/bluetooth/bluez/leadvertisement1_p.h
@@ -0,0 +1,97 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a leadvertisement1_p.h:leadvertisement1.cpp -c OrgBluezLEAdvertisement1Adaptor -i bluez5_helper_p.h org.bluez.LEAdvertisement1.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef LEADVERTISEMENT1_P_H
+#define LEADVERTISEMENT1_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "bluez5_helper_p.h"
+#include <QtCore/qcontainerfwd.h>
+
+/*
+ * Adaptor class for interface org.bluez.LEAdvertisement1
+ */
+class OrgBluezLEAdvertisement1Adaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.bluez.LEAdvertisement1")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.bluez.LEAdvertisement1\">\n"
+" <method name=\"Release\">\n"
+" <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
+" </method>\n"
+" <property access=\"readwrite\" type=\"s\" name=\"Type\"/>\n"
+" <property access=\"readwrite\" type=\"as\" name=\"ServiceUUIDs\"/>\n"
+" <property access=\"readwrite\" type=\"a{qv}\" name=\"ManufacturerData\">\n"
+" <annotation value=\"ManufacturerDataList\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
+" </property>\n"
+" <property access=\"readwrite\" type=\"b\" name=\"Discoverable\"/>\n"
+" <property access=\"readwrite\" type=\"as\" name=\"Includes\"/>\n"
+" <property access=\"readwrite\" type=\"s\" name=\"LocalName\"/>\n"
+" <property access=\"readwrite\" type=\"u\" name=\"MinInterval\"/>\n"
+" <property access=\"readwrite\" type=\"u\" name=\"MaxInterval\"/>\n"
+" </interface>\n"
+ "")
+public:
+ OrgBluezLEAdvertisement1Adaptor(QObject *parent);
+ virtual ~OrgBluezLEAdvertisement1Adaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(bool Discoverable READ discoverable WRITE setDiscoverable)
+ bool discoverable() const;
+ void setDiscoverable(bool value);
+
+ Q_PROPERTY(QStringList Includes READ includes WRITE setIncludes)
+ QStringList includes() const;
+ void setIncludes(const QStringList &value);
+
+ Q_PROPERTY(QString LocalName READ localName WRITE setLocalName)
+ QString localName() const;
+ void setLocalName(const QString &value);
+
+ Q_PROPERTY(ManufacturerDataList ManufacturerData READ manufacturerData WRITE setManufacturerData)
+ ManufacturerDataList manufacturerData() const;
+ void setManufacturerData(ManufacturerDataList value);
+
+ Q_PROPERTY(uint MaxInterval READ maxInterval WRITE setMaxInterval)
+ uint maxInterval() const;
+ void setMaxInterval(uint value);
+
+ Q_PROPERTY(uint MinInterval READ minInterval WRITE setMinInterval)
+ uint minInterval() const;
+ void setMinInterval(uint value);
+
+ Q_PROPERTY(QStringList ServiceUUIDs READ serviceUUIDs WRITE setServiceUUIDs)
+ QStringList serviceUUIDs() const;
+ void setServiceUUIDs(const QStringList &value);
+
+ Q_PROPERTY(QString Type READ type WRITE setType)
+ QString type() const;
+ void setType(const QString &value);
+
+public Q_SLOTS: // METHODS
+ Q_NOREPLY void Release();
+Q_SIGNALS: // SIGNALS
+};
+
+#endif
diff --git a/src/bluetooth/bluez/leadvertisingmanager1.cpp b/src/bluetooth/bluez/leadvertisingmanager1.cpp
new file mode 100644
index 00000000..29690163
--- /dev/null
+++ b/src/bluetooth/bluez/leadvertisingmanager1.cpp
@@ -0,0 +1,28 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p leadvertisingmanager1_p.h:leadvertisingmanager1.cpp org.bluez.LEAdvertisingManager1.xml --moc
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#include "leadvertisingmanager1_p.h"
+
+/*
+ * Implementation of interface class OrgBluezLEAdvertisingManager1Interface
+ */
+
+OrgBluezLEAdvertisingManager1Interface::OrgBluezLEAdvertisingManager1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
+ : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
+{
+}
+
+OrgBluezLEAdvertisingManager1Interface::~OrgBluezLEAdvertisingManager1Interface()
+{
+}
+
+
+#include "moc_leadvertisingmanager1_p.cpp"
diff --git a/src/bluetooth/bluez/leadvertisingmanager1_p.h b/src/bluetooth/bluez/leadvertisingmanager1_p.h
new file mode 100644
index 00000000..06a299b3
--- /dev/null
+++ b/src/bluetooth/bluez/leadvertisingmanager1_p.h
@@ -0,0 +1,85 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p leadvertisingmanager1_p.h:leadvertisingmanager1.cpp org.bluez.LEAdvertisingManager1.xml --moc
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#ifndef LEADVERTISINGMANAGER1_P_H
+#define LEADVERTISINGMANAGER1_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
+
+/*
+ * Proxy class for interface org.bluez.LEAdvertisingManager1
+ */
+class OrgBluezLEAdvertisingManager1Interface: public QDBusAbstractInterface
+{
+ Q_OBJECT
+public:
+ static inline const char *staticInterfaceName()
+ { return "org.bluez.LEAdvertisingManager1"; }
+
+public:
+ OrgBluezLEAdvertisingManager1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
+
+ ~OrgBluezLEAdvertisingManager1Interface();
+
+ Q_PROPERTY(uchar ActiveInstances READ activeInstances)
+ inline uchar activeInstances() const
+ { return qvariant_cast< uchar >(property("ActiveInstances")); }
+
+ Q_PROPERTY(QStringList SupportedIncludes READ supportedIncludes)
+ inline QStringList supportedIncludes() const
+ { return qvariant_cast< QStringList >(property("SupportedIncludes")); }
+
+ Q_PROPERTY(uchar SupportedInstances READ supportedInstances)
+ inline uchar supportedInstances() const
+ { return qvariant_cast< uchar >(property("SupportedInstances")); }
+
+public Q_SLOTS: // METHODS
+ inline QDBusPendingReply<> RegisterAdvertisement(const QDBusObjectPath &advertisement, const QVariantMap &options)
+ {
+ QList<QVariant> argumentList;
+ argumentList << QVariant::fromValue(advertisement) << QVariant::fromValue(options);
+ return asyncCallWithArgumentList(QStringLiteral("RegisterAdvertisement"), argumentList);
+ }
+
+ inline QDBusPendingReply<> UnregisterAdvertisement(const QDBusObjectPath &advertisement)
+ {
+ QList<QVariant> argumentList;
+ argumentList << QVariant::fromValue(advertisement);
+ return asyncCallWithArgumentList(QStringLiteral("UnregisterAdvertisement"), argumentList);
+ }
+
+Q_SIGNALS: // SIGNALS
+};
+
+namespace org {
+ namespace bluez {
+ using LEAdvertisingManager1 = ::OrgBluezLEAdvertisingManager1Interface;
+ }
+}
+#endif
diff --git a/src/bluetooth/bluez/manager.cpp b/src/bluetooth/bluez/manager.cpp
deleted file mode 100644
index 8ca6fb42..00000000
--- a/src/bluetooth/bluez/manager.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p manager_p.h:manager.cpp org.bluez.Manager.xml org.bluez.Manager
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "manager_p.h"
-
-/*
- * Implementation of interface class OrgBluezManagerInterface
- */
-
-OrgBluezManagerInterface::OrgBluezManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezManagerInterface::~OrgBluezManagerInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/manager_p.h b/src/bluetooth/bluez/manager_p.h
deleted file mode 100644
index a969e067..00000000
--- a/src/bluetooth/bluez/manager_p.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p manager_p.h:manager.cpp org.bluez.Manager.xml org.bluez.Manager
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef MANAGER_P_H
-#define MANAGER_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.Manager
- */
-class OrgBluezManagerInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.Manager"; }
-
-public:
- OrgBluezManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezManagerInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QDBusObjectPath> DefaultAdapter()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("DefaultAdapter"), argumentList);
- }
-
- inline QDBusPendingReply<QDBusObjectPath> FindAdapter(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("FindAdapter"), argumentList);
- }
-
- inline QDBusPendingReply<QList<QDBusObjectPath> > ListAdapters()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("ListAdapters"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void AdapterAdded(const QDBusObjectPath &in0);
- void AdapterRemoved(const QDBusObjectPath &in0);
- void DefaultAdapterChanged(const QDBusObjectPath &in0);
-};
-
-namespace org {
- namespace bluez {
- typedef ::OrgBluezManagerInterface Manager;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/obex_agent.cpp b/src/bluetooth/bluez/obex_agent.cpp
deleted file mode 100644
index 5bc05f87..00000000
--- a/src/bluetooth/bluez/obex_agent.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -a obex_agent_p.h:obex_agent.cpp org.openobex.agent.xml org.openobex.Agent
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "obex_agent_p.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class AgentAdaptor
- */
-
-AgentAdaptor::AgentAdaptor(QObject *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-AgentAdaptor::~AgentAdaptor()
-{
- // destructor
-}
-
-void AgentAdaptor::Complete(const QDBusObjectPath &in0)
-{
- // handle method call org.openobex.Agent.Complete
- QMetaObject::invokeMethod(parent(), "Complete", Q_ARG(QDBusObjectPath, in0));
-}
-
-void AgentAdaptor::Error(const QDBusObjectPath &in0, const QString &in1)
-{
- // handle method call org.openobex.Agent.Error
- QMetaObject::invokeMethod(parent(), "Error", Q_ARG(QDBusObjectPath, in0), Q_ARG(QString, in1));
-}
-
-void AgentAdaptor::Progress(const QDBusObjectPath &in0, qulonglong in1)
-{
- // handle method call org.openobex.Agent.Progress
- QMetaObject::invokeMethod(parent(), "Progress", Q_ARG(QDBusObjectPath, in0), Q_ARG(qulonglong, in1));
-}
-
-void AgentAdaptor::Release()
-{
- // handle method call org.openobex.Agent.Release
- QMetaObject::invokeMethod(parent(), "Release");
-}
-
-QString AgentAdaptor::Request(const QDBusObjectPath &in0)
-{
- // handle method call org.openobex.Agent.Request
- QString out0;
- QMetaObject::invokeMethod(parent(), "Request", Q_RETURN_ARG(QString, out0), Q_ARG(QDBusObjectPath, in0));
- return out0;
-}
-
diff --git a/src/bluetooth/bluez/obex_agent_p.h b/src/bluetooth/bluez/obex_agent_p.h
deleted file mode 100644
index b370810d..00000000
--- a/src/bluetooth/bluez/obex_agent_p.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -a obex_agent_p.h:obex_agent.cpp org.openobex.agent.xml org.openobex.Agent
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef OBEX_AGENT_P_H
-#define OBEX_AGENT_P_H
-
-#include <QtCore/QObject>
-#include <QtCore/qcontainerfwd.h>
-#include <QtDBus/QtDBus>
-QT_BEGIN_NAMESPACE
-class QByteArray;
-class QString;
-class QStringList;
-class QVariant;
-QT_END_NAMESPACE
-
-/*
- * Adaptor class for interface org.openobex.Agent
- */
-class AgentAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.openobex.Agent")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.openobex.Agent\">\n"
-" <method name=\"Release\"/>\n"
-" <method name=\"Request\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"out\" type=\"s\"/>\n"
-" </method>\n"
-" <method name=\"Progress\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"in\" type=\"t\"/>\n"
-" </method>\n"
-" <method name=\"Complete\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" </method>\n"
-" <method name=\"Error\">\n"
-" <arg direction=\"in\" type=\"o\"/>\n"
-" <arg direction=\"in\" type=\"s\"/>\n"
-" </method>\n"
-" </interface>\n"
- "")
-public:
- AgentAdaptor(QObject *parent);
- virtual ~AgentAdaptor();
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- void Complete(const QDBusObjectPath &in0);
- void Error(const QDBusObjectPath &in0, const QString &in1);
- void Progress(const QDBusObjectPath &in0, qulonglong in1);
- void Release();
- QString Request(const QDBusObjectPath &in0);
-Q_SIGNALS: // SIGNALS
-};
-
-#endif
diff --git a/src/bluetooth/bluez/obex_client.cpp b/src/bluetooth/bluez/obex_client.cpp
deleted file mode 100644
index bef9155a..00000000
--- a/src/bluetooth/bluez/obex_client.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_client_p.h:obex_client.cpp org.openobex.client.xml org.openobex.Client
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "obex_client_p.h"
-
-/*
- * Implementation of interface class OrgOpenobexClientInterface
- */
-
-OrgOpenobexClientInterface::OrgOpenobexClientInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgOpenobexClientInterface::~OrgOpenobexClientInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/obex_client1_bluez5.cpp b/src/bluetooth/bluez/obex_client1_bluez5.cpp
deleted file mode 100644
index fb66708a..00000000
--- a/src/bluetooth/bluez/obex_client1_bluez5.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp org.bluez.Client1.xml -p asd
- *
- * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "obex_client1_bluez5_p.h"
-
-/*
- * Implementation of interface class OrgBluezObexClient1Interface
- */
-
-OrgBluezObexClient1Interface::OrgBluezObexClient1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezObexClient1Interface::~OrgBluezObexClient1Interface()
-{
-}
-
diff --git a/src/bluetooth/bluez/obex_client1_bluez5_p.h b/src/bluetooth/bluez/obex_client1_bluez5_p.h
deleted file mode 100644
index ccd5b0d6..00000000
--- a/src/bluetooth/bluez/obex_client1_bluez5_p.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_client1_bluez5_p.h:obex_client1_bluez5_p.h org.bluez.Client1.xml
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef OBEX_CLIENT1_BLUEZ5_P_H
-#define OBEX_CLIENT1_BLUEZ5_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.obex.Client1
- */
-class OrgBluezObexClient1Interface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.obex.Client1"; }
-
-public:
- OrgBluezObexClient1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezObexClient1Interface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QDBusObjectPath> CreateSession(const QString &destination, const QVariantMap &args)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(destination) << QVariant::fromValue(args);
- return asyncCallWithArgumentList(QStringLiteral("CreateSession"), argumentList);
- }
-
- inline QDBusPendingReply<> RemoveSession(const QDBusObjectPath &session)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(session);
- return asyncCallWithArgumentList(QStringLiteral("RemoveSession"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace bluez {
- namespace obex {
- typedef ::OrgBluezObexClient1Interface Client1;
- }
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/obex_client_p.h b/src/bluetooth/bluez/obex_client_p.h
deleted file mode 100644
index 13b638b6..00000000
--- a/src/bluetooth/bluez/obex_client_p.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_client_p.h:obex_client.cpp org.openobex.client.xml org.openobex.Client
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef OBEX_CLIENT_P_H
-#define OBEX_CLIENT_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.openobex.Client
- */
-class OrgOpenobexClientInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.openobex.Client"; }
-
-public:
- OrgOpenobexClientInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgOpenobexClientInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QDBusObjectPath> CreateSession(const QVariantMap &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("CreateSession"), argumentList);
- }
-
- inline QDBusPendingReply<> ExchangeBusinessCards(const QVariantMap &in0, const QString &in1, const QString &in2)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
- return asyncCallWithArgumentList(QStringLiteral("ExchangeBusinessCards"), argumentList);
- }
-
- inline QDBusPendingReply<QString> GetCapabilities(const QVariantMap &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("GetCapabilities"), argumentList);
- }
-
- inline QDBusPendingReply<> PullBusinessCard(const QVariantMap &in0, const QString &in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("PullBusinessCard"), argumentList);
- }
-
- inline QDBusPendingReply<> SendFiles(const QVariantMap &in0, const QStringList &in1, const QDBusObjectPath &in2)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
- return asyncCallWithArgumentList(QStringLiteral("SendFiles"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace openobex {
- typedef ::OrgOpenobexClientInterface Client;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/obex_manager.cpp b/src/bluetooth/bluez/obex_manager.cpp
deleted file mode 100644
index cc6e0ecb..00000000
--- a/src/bluetooth/bluez/obex_manager.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_manager_p.h:obex_manager.cpp org.openobex.all.xml org.openobex.Manager
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "obex_manager_p.h"
-
-/*
- * Implementation of interface class OrgOpenobexManagerInterface
- */
-
-OrgOpenobexManagerInterface::OrgOpenobexManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgOpenobexManagerInterface::~OrgOpenobexManagerInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/obex_manager_p.h b/src/bluetooth/bluez/obex_manager_p.h
deleted file mode 100644
index 822954ab..00000000
--- a/src/bluetooth/bluez/obex_manager_p.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_manager_p.h:obex_manager.cpp org.openobex.all.xml org.openobex.Manager
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef OBEX_MANAGER_P_H
-#define OBEX_MANAGER_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.openobex.Manager
- */
-class OrgOpenobexManagerInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.openobex.Manager"; }
-
-public:
- OrgOpenobexManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgOpenobexManagerInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> RegisterAgent(const QDBusObjectPath &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("RegisterAgent"), argumentList);
- }
-
- inline QDBusPendingReply<> UnregisterAgent(const QDBusObjectPath &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("UnregisterAgent"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void SessionCreated(const QDBusObjectPath &in0);
- void SessionRemoved(const QDBusObjectPath &in0);
- void TransferCompleted(const QDBusObjectPath &in0, bool in1);
- void TransferStarted(const QDBusObjectPath &in0);
-};
-
-namespace org {
- namespace openobex {
- typedef ::OrgOpenobexManagerInterface Manager;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/obex_objectpush1_bluez5.cpp b/src/bluetooth/bluez/obex_objectpush1_bluez5.cpp
deleted file mode 100644
index 59b94e80..00000000
--- a/src/bluetooth/bluez/obex_objectpush1_bluez5.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_objectpush1_bluez5_p.h:obex_objectpush1_bluez5.cpp org.bluez.obex.ObjectPush1.xml
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "obex_objectpush1_bluez5_p.h"
-
-/*
- * Implementation of interface class OrgBluezObexObjectPush1Interface
- */
-
-OrgBluezObexObjectPush1Interface::OrgBluezObexObjectPush1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezObexObjectPush1Interface::~OrgBluezObexObjectPush1Interface()
-{
-}
-
diff --git a/src/bluetooth/bluez/obex_objectpush1_bluez5_p.h b/src/bluetooth/bluez/obex_objectpush1_bluez5_p.h
deleted file mode 100644
index 5fa1703b..00000000
--- a/src/bluetooth/bluez/obex_objectpush1_bluez5_p.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_objectpush1_bluez5_p.h:obex_objectpush1_bluez5.cpp org.bluez.obex.ObjectPush1.xml
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef OBEX_OBJECTPUSH1_BLUEZ5_P_H
-#define OBEX_OBJECTPUSH1_BLUEZ5_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.obex.ObjectPush1
- */
-class OrgBluezObexObjectPush1Interface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.obex.ObjectPush1"; }
-
-public:
- OrgBluezObexObjectPush1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezObexObjectPush1Interface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QDBusObjectPath, QVariantMap> ExchangeBusinessCards(const QString &clientfile, const QString &targetfile)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(clientfile) << QVariant::fromValue(targetfile);
- return asyncCallWithArgumentList(QStringLiteral("ExchangeBusinessCards"), argumentList);
- }
- inline QDBusReply<QDBusObjectPath> ExchangeBusinessCards(const QString &clientfile, const QString &targetfile, QVariantMap &properties)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(clientfile) << QVariant::fromValue(targetfile);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("ExchangeBusinessCards"), argumentList);
- if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
- properties = qdbus_cast<QVariantMap>(reply.arguments().at(1));
- }
- return reply;
- }
-
- inline QDBusPendingReply<QDBusObjectPath, QVariantMap> PullBusinessCard(const QString &targetfile)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(targetfile);
- return asyncCallWithArgumentList(QStringLiteral("PullBusinessCard"), argumentList);
- }
- inline QDBusReply<QDBusObjectPath> PullBusinessCard(const QString &targetfile, QVariantMap &properties)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(targetfile);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("PullBusinessCard"), argumentList);
- if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
- properties = qdbus_cast<QVariantMap>(reply.arguments().at(1));
- }
- return reply;
- }
-
- inline QDBusPendingReply<QDBusObjectPath, QVariantMap> SendFile(const QString &sourcefile)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(sourcefile);
- return asyncCallWithArgumentList(QStringLiteral("SendFile"), argumentList);
- }
- inline QDBusReply<QDBusObjectPath> SendFile(const QString &sourcefile, QVariantMap &properties)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(sourcefile);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("SendFile"), argumentList);
- if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
- properties = qdbus_cast<QVariantMap>(reply.arguments().at(1));
- }
- return reply;
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace bluez {
- namespace obex {
- typedef ::OrgBluezObexObjectPush1Interface ObjectPush1;
- }
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/obex_transfer.cpp b/src/bluetooth/bluez/obex_transfer.cpp
deleted file mode 100644
index be27362f..00000000
--- a/src/bluetooth/bluez/obex_transfer.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_transfer_p.h:obex_transfer.cpp org.openobex.transfer.xml org.openobex.Transfer
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "obex_transfer_p.h"
-
-/*
- * Implementation of interface class OrgOpenobexTransferInterface
- */
-
-OrgOpenobexTransferInterface::OrgOpenobexTransferInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgOpenobexTransferInterface::~OrgOpenobexTransferInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/obex_transfer1_bluez5.cpp b/src/bluetooth/bluez/obex_transfer1_bluez5.cpp
deleted file mode 100644
index 8cddd05e..00000000
--- a/src/bluetooth/bluez/obex_transfer1_bluez5.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp org.bluez.obex.Transfer1.xml -p obex_transfer1_bluez5
- *
- * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "obex_transfer1_bluez5_p.h"
-
-/*
- * Implementation of interface class OrgBluezObexTransfer1Interface
- */
-
-OrgBluezObexTransfer1Interface::OrgBluezObexTransfer1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezObexTransfer1Interface::~OrgBluezObexTransfer1Interface()
-{
-}
-
diff --git a/src/bluetooth/bluez/obex_transfer1_bluez5_p.h b/src/bluetooth/bluez/obex_transfer1_bluez5_p.h
deleted file mode 100644
index ccde588e..00000000
--- a/src/bluetooth/bluez/obex_transfer1_bluez5_p.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_transfer1_bluez5_p.h:obex_transfer1_bluez5_p.h org.bluez.obex.Transfer1.xml
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef OBEX_TRANSFER1_BLUEZ5_P_H
-#define OBEX_TRANSFER1_BLUEZ5_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.obex.Transfer1
- */
-class OrgBluezObexTransfer1Interface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.obex.Transfer1"; }
-
-public:
- OrgBluezObexTransfer1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezObexTransfer1Interface();
-
- Q_PROPERTY(QString Filename READ filename)
- inline QString filename() const
- { return qvariant_cast< QString >(property("Filename")); }
-
- Q_PROPERTY(QString Name READ name)
- inline QString name() const
- { return qvariant_cast< QString >(property("Name")); }
-
- Q_PROPERTY(QDBusObjectPath Session READ session)
- inline QDBusObjectPath session() const
- { return qvariant_cast< QDBusObjectPath >(property("Session")); }
-
- Q_PROPERTY(qulonglong Size READ size)
- inline qulonglong size() const
- { return qvariant_cast< qulonglong >(property("Size")); }
-
- Q_PROPERTY(QString Status READ status)
- inline QString status() const
- { return qvariant_cast< QString >(property("Status")); }
-
- Q_PROPERTY(qulonglong Transferred READ transferred)
- inline qulonglong transferred() const
- { return qvariant_cast< qulonglong >(property("Transferred")); }
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> Cancel()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("Cancel"), argumentList);
- }
-
- inline QDBusPendingReply<> Resume()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("Resume"), argumentList);
- }
-
- inline QDBusPendingReply<> Suspend()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("Suspend"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace bluez {
- namespace obex {
- typedef ::OrgBluezObexTransfer1Interface Transfer1;
- }
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/obex_transfer_p.h b/src/bluetooth/bluez/obex_transfer_p.h
deleted file mode 100644
index b8fa0a5d..00000000
--- a/src/bluetooth/bluez/obex_transfer_p.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p obex_transfer_p.h:obex_transfer.cpp org.openobex.transfer.xml org.openobex.Transfer
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef OBEX_TRANSFER_P_H
-#define OBEX_TRANSFER_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.openobex.Transfer
- */
-class OrgOpenobexTransferInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.openobex.Transfer"; }
-
-public:
- OrgOpenobexTransferInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgOpenobexTransferInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> Cancel()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("Cancel"), argumentList);
- }
-
- inline QDBusPendingReply<QVariantMap> GetProperties()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetProperties"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace openobex {
- typedef ::OrgOpenobexTransferInterface Transfer;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/objectmanager.cpp b/src/bluetooth/bluez/objectmanager.cpp
index 4484ea27..dd232c6d 100644
--- a/src/bluetooth/bluez/objectmanager.cpp
+++ b/src/bluetooth/bluez/objectmanager.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p objectmanager_p.h:objectmanager.cpp org.freedesktop.dbus.objectmanager.xml
+ * Command line was: qdbusxml2cpp -i bluez5_helper_p.h -I QtCore/private/qglobal_p.h -p objectmanager_p.h:objectmanager.cpp org.freedesktop.dbus.objectmanager.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgFreedesktopDBusObjectManagerInterface::~OrgFreedesktopDBusObjectManagerInterf
{
}
+
+#include "moc_objectmanager_p.cpp"
diff --git a/src/bluetooth/bluez/objectmanager_p.h b/src/bluetooth/bluez/objectmanager_p.h
index 7aa2f35b..d76eeb54 100644
--- a/src/bluetooth/bluez/objectmanager_p.h
+++ b/src/bluetooth/bluez/objectmanager_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p objectmanager_p.h:objectmanager.cpp org.freedesktop.dbus.objectmanager.xml
+ * Command line was: qdbusxml2cpp -i bluez5_helper_p.h -I QtCore/private/qglobal_p.h -p objectmanager_p.h:objectmanager.cpp org.freedesktop.dbus.objectmanager.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef OBJECTMANAGER_P_H
#define OBJECTMANAGER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,8 +30,8 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
-
#include "bluez5_helper_p.h"
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.freedesktop.DBus.ObjectManager
@@ -52,7 +63,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace freedesktop {
namespace DBus {
- typedef ::OrgFreedesktopDBusObjectManagerInterface ObjectManager;
+ using ObjectManager = ::OrgFreedesktopDBusObjectManagerInterface;
}
}
}
diff --git a/src/bluetooth/bluez/objectmanageradaptor.cpp b/src/bluetooth/bluez/objectmanageradaptor.cpp
new file mode 100644
index 00000000..575a7f22
--- /dev/null
+++ b/src/bluetooth/bluez/objectmanageradaptor.cpp
@@ -0,0 +1,42 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a objectmanageradaptor_p.h:objectmanageradaptor.cpp -c OrgFreedesktopDBusObjectManagerAdaptor -i bluez5_helper_p.h org.freedesktop.dbus.objectmanager.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "objectmanageradaptor_p.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class OrgFreedesktopDBusObjectManagerAdaptor
+ */
+
+OrgFreedesktopDBusObjectManagerAdaptor::OrgFreedesktopDBusObjectManagerAdaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+OrgFreedesktopDBusObjectManagerAdaptor::~OrgFreedesktopDBusObjectManagerAdaptor()
+{
+ // destructor
+}
+
+ManagedObjectList OrgFreedesktopDBusObjectManagerAdaptor::GetManagedObjects()
+{
+ // handle method call org.freedesktop.DBus.ObjectManager.GetManagedObjects
+ ManagedObjectList object_paths_interfaces_and_properties;
+ QMetaObject::invokeMethod(parent(), "GetManagedObjects", Q_RETURN_ARG(ManagedObjectList, object_paths_interfaces_and_properties));
+ return object_paths_interfaces_and_properties;
+}
diff --git a/src/bluetooth/bluez/objectmanageradaptor_p.h b/src/bluetooth/bluez/objectmanageradaptor_p.h
new file mode 100644
index 00000000..17579a25
--- /dev/null
+++ b/src/bluetooth/bluez/objectmanageradaptor_p.h
@@ -0,0 +1,67 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a objectmanageradaptor_p.h:objectmanageradaptor.cpp -c OrgFreedesktopDBusObjectManagerAdaptor -i bluez5_helper_p.h org.freedesktop.dbus.objectmanager.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef OBJECTMANAGERADAPTOR_P_H
+#define OBJECTMANAGERADAPTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "bluez5_helper_p.h"
+#include <QtCore/qcontainerfwd.h>
+
+/*
+ * Adaptor class for interface org.freedesktop.DBus.ObjectManager
+ */
+class OrgFreedesktopDBusObjectManagerAdaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.freedesktop.DBus.ObjectManager")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.freedesktop.DBus.ObjectManager\">\n"
+" <method name=\"GetManagedObjects\">\n"
+" <arg direction=\"out\" type=\"a{oa{sa{sv}}}\" name=\"object_paths_interfaces_and_properties\"/>\n"
+" <annotation value=\"ManagedObjectList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
+" </method>\n"
+" <signal name=\"InterfacesAdded\">\n"
+" <arg type=\"o\" name=\"object_path\"/>\n"
+" <arg type=\"a{sa{sv}}\" name=\"interfaces_and_properties\"/>\n"
+" <annotation value=\"InterfaceList\" name=\"org.qtproject.QtDBus.QtTypeName.Out1\"/>\n"
+" </signal>\n"
+" <signal name=\"InterfacesRemoved\">\n"
+" <arg type=\"o\" name=\"object_path\"/>\n"
+" <arg type=\"as\" name=\"interfaces\"/>\n"
+" </signal>\n"
+" </interface>\n"
+ "")
+public:
+ OrgFreedesktopDBusObjectManagerAdaptor(QObject *parent);
+ virtual ~OrgFreedesktopDBusObjectManagerAdaptor();
+
+public: // PROPERTIES
+public Q_SLOTS: // METHODS
+ ManagedObjectList GetManagedObjects();
+Q_SIGNALS: // SIGNALS
+ void InterfacesAdded(const QDBusObjectPath &object_path, InterfaceList interfaces_and_properties);
+ void InterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces);
+};
+
+#endif
diff --git a/src/bluetooth/bluez/org.bluez.Agent.xml b/src/bluetooth/bluez/org.bluez.Agent.xml
deleted file mode 100644
index 9a77eb1b..00000000
--- a/src/bluetooth/bluez/org.bluez.Agent.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/">
- <interface name="org.bluez.Agent">
- <method name="Release" />
- <method name="RequestPinCode">
- <arg type="o" direction="in"/>
- <arg type="s" direction="out"/>
- </method>
- <method name="RequestPasskey">
- <arg type="o" direction="in"/>
- <arg type="u" direction="out"/>
- </method>
- <method name="DisplayPasskey">
- <arg type="o" direction="in"/>
- <arg type="u" direction="in"/>
- <arg type="y" direction="in"/>
- </method>
- <method name="RequestConfirmation">
- <arg type="o" direction="in"/>
- <arg type="u" direction="in"/>
- </method>
- <method name="Authorize">
- <arg type="o" direction="in"/>
- <arg type="s" direction="in"/>
- </method>
- <method name="ConfirmModeChange">
- <arg type="s" direction="in"/>
- </method>
- <method name="Cancel" />
- </interface>
- <node name="org"/>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.Client1.xml b/src/bluetooth/bluez/org.bluez.Client1.xml
deleted file mode 100644
index 8a5a25c1..00000000
--- a/src/bluetooth/bluez/org.bluez.Client1.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.bluez.obex.Client1">
- <method name="CreateSession">
- <arg name="destination" type="s" direction="in"/>
- <arg name="args" type="a{sv}" direction="in"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
- <arg name="session" type="o" direction="out"/>
- </method>
- <method name="RemoveSession">
- <arg name="session" type="o" direction="in"/>
- </method>
- </interface>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.Device.xml b/src/bluetooth/bluez/org.bluez.Device.xml
deleted file mode 100644
index 42351c97..00000000
--- a/src/bluetooth/bluez/org.bluez.Device.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/org/bluez/3003/hci0/dev_XX_XX_XX_XX_XX_XX">
- <interface name="org.bluez.Device">
- <method name="GetProperties">
- <arg type="a{sv}" direction="out"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
- </method>
- <method name="SetProperty">
- <arg type="s" direction="in"/>
- <arg type="v" direction="in"/>
- </method>
- <method name="DiscoverServices">
- <arg type="s" direction="in"/>
- <arg type="a{us}" direction="out"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="ServiceMap"/>
- </method>
- <method name="CancelDiscovery"/>
- <method name="Disconnect"/>
- <method name="ListNodes">
- <arg type="ao" direction="out"/>
- </method>
- <method name="CreateNode">
- <arg type="s" direction="in"/>
- <arg type="o" direction="out"/>
- </method>
- <method name="RemoveNode">
- <arg type="o" direction="in"/>
- </method>
- <signal name="PropertyChanged">
- <arg type="s"/>
- <arg type="v"/>
- </signal>
- <signal name="DisconnectRequested"/>
- <signal name="NodeCreated">
- <arg type="o"/>
- </signal>
- <signal name="NodeRemoved">
- <arg type="o"/>
- </signal>
- </interface>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.Device1.xml b/src/bluetooth/bluez/org.bluez.Device1.xml
index 554d0b53..cd4cba77 100644
--- a/src/bluetooth/bluez/org.bluez.Device1.xml
+++ b/src/bluetooth/bluez/org.bluez.Device1.xml
@@ -29,10 +29,10 @@
<property name="Adapter" type="o" access="read"></property>
<!-- ManufacturerData & ServiceData introduced by Bluez 5.31 -->
<property name="ManufacturerData" type="a{qv}" access="read">
- <annotation name="org.qtproject.QtDBus.QtTypeName" value="ManufacturerDataList"/>
+ <annotation name="org.qtproject.QtDBus.QtTypeName" value="ManufacturerDataList"/>
</property>
<property name="ServiceData" type="a{sv}" access="read">
- <annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariantMap"/>
+ <annotation name="org.qtproject.QtDBus.QtTypeName" value="ServiceDataList"/>
</property>
<!-- TxPower and ServicesResolved introduced by Bluez 5.42 -->
<property name="TxPower" type="n" access="read"></property>
diff --git a/src/bluetooth/bluez/org.bluez.GattManager1.xml b/src/bluetooth/bluez/org.bluez.GattManager1.xml
new file mode 100644
index 00000000..ca7819b0
--- /dev/null
+++ b/src/bluetooth/bluez/org.bluez.GattManager1.xml
@@ -0,0 +1,14 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.bluez.GattManager1">
+ <method name="RegisterApplication">
+ <arg name="application" type="o" direction="in"/>
+ <arg name="options" type="a{sv}" direction="in"/>
+ <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
+ </method>
+ <method name="UnregisterApplication">
+ <arg name="application" type="o" direction="in"/>
+ </method>
+ </interface>
+</node>
diff --git a/src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml b/src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml
new file mode 100644
index 00000000..845dbccf
--- /dev/null
+++ b/src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml
@@ -0,0 +1,29 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.bluez.LEAdvertisement1">
+ <method name="Release">
+ <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
+ </method>
+ <property name="Type" type="s" access="readwrite"/>
+ <property name="ServiceUUIDs" type="as" access="readwrite"/>
+ <property name="ManufacturerData" type="a{qv}" access="readwrite">
+ <annotation name="org.qtproject.QtDBus.QtTypeName" value="ManufacturerDataList"/>
+ </property>
+ <!-- SolicitUUIDs -->
+ <!-- ServiceData -->
+ <!-- Data experimental -->
+ <property name="Discoverable" type="b" access="readwrite"/>
+ <!-- DiscoverableTimeout experimental -->
+ <property name="Includes" type="as" access="readwrite"/>
+ <property name="LocalName" type="s" access="readwrite"/>
+ <!-- Appearance -->
+ <!-- Duration -->
+ <!-- Timeout -->
+ <!-- SecondaryChannel experimental -->
+ <!-- min max intervals are experimental -->
+ <property name="MinInterval" type="u" access="readwrite"/>
+ <property name="MaxInterval" type="u" access="readwrite"/>
+ <!-- TxPower experimental -->
+ </interface>
+</node>
diff --git a/src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml b/src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml
new file mode 100644
index 00000000..f8e1e49a
--- /dev/null
+++ b/src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml
@@ -0,0 +1,20 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.bluez.LEAdvertisingManager1">
+ <method name="RegisterAdvertisement">
+ <arg name="advertisement" type="o" direction="in"/>
+ <arg name="options" type="a{sv}" direction="in"/>
+ <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
+ </method>
+ <method name="UnregisterAdvertisement">
+ <arg name="advertisement" type="o" direction="in"/>
+ </method>
+ <property name="ActiveInstances" type="y" access="read"/>
+ <property name="SupportedInstances" type="y" access="read"/>
+ <property name="SupportedIncludes" type="as" access="read"/>
+ <!-- SupportedSecondaryChannels experimental -->
+ <!-- SupportedFeatures experimental -->
+ <!-- SupportedCapabilities experimental -->
+ </interface>
+</node>
diff --git a/src/bluetooth/bluez/org.bluez.Manager.xml b/src/bluetooth/bluez/org.bluez.Manager.xml
deleted file mode 100644
index 60b9baba..00000000
--- a/src/bluetooth/bluez/org.bluez.Manager.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/">
- <interface name="org.bluez.Manager">
- <method name="DefaultAdapter">
- <arg type="o" direction="out"/>
- </method>
- <method name="FindAdapter">
- <arg type="s" direction="in"/>
- <arg type="o" direction="out"/>
- </method>
- <method name="ListAdapters">
- <arg type="ao" direction="out"/>
- </method>
- <signal name="AdapterAdded">
- <arg type="o"/>
- </signal>
- <signal name="AdapterRemoved">
- <arg type="o"/>
- </signal>
- <signal name="DefaultAdapterChanged">
- <arg type="o"/>
- </signal>
- </interface>
- <node name="org"/>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.Service.xml b/src/bluetooth/bluez/org.bluez.Service.xml
deleted file mode 100644
index e18516a3..00000000
--- a/src/bluetooth/bluez/org.bluez.Service.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/org/bluez/3003/any">
- <interface name="org.bluez.Service">
- <method name="AddRecord">
- <arg type="s" direction="in"/>
- <arg type="u" direction="out"/>
- </method>
- <method name="UpdateRecord">
- <arg type="u" direction="in"/>
- <arg type="s" direction="in"/>
- </method>
- <method name="RemoveRecord">
- <arg type="u" direction="in"/>
- </method>
- <method name="RequestAuthorization">
- <arg type="s" direction="in"/>
- <arg type="u" direction="in"/>
- </method>
- <method name="CancelAuthorization"/>
- </interface>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.all.xml b/src/bluetooth/bluez/org.bluez.all.xml
deleted file mode 100644
index b48a01f3..00000000
--- a/src/bluetooth/bluez/org.bluez.all.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/org/bluez/3003/hci0">
- <interface name="org.bluez.Adapter">
- <method name="GetProperties">
- <arg type="a{sv}" direction="out"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
- </method>
- <method name="SetProperty">
- <arg type="s" direction="in"/>
- <arg type="v" direction="in"/>
- </method>
- <method name="RequestMode">
- <arg type="s" direction="in"/>
- </method>
- <method name="ReleaseMode"/>
- <method name="RequestSession"/>
- <method name="ReleaseSession"/>
- <method name="StartDiscovery"/>
- <method name="StopDiscovery"/>
- <method name="ListDevices">
- <arg type="ao" direction="out"/>
- </method>
- <method name="CreateDevice">
- <arg type="s" direction="in"/>
- <arg type="o" direction="out"/>
- </method>
- <method name="CreatePairedDevice">
- <arg type="s" direction="in"/>
- <arg type="o" direction="in"/>
- <arg type="s" direction="in"/>
- <arg type="o" direction="out"/>
- </method>
- <method name="CancelDeviceCreation">
- <arg type="s" direction="in"/>
- </method>
- <method name="RemoveDevice">
- <arg type="o" direction="in"/>
- </method>
- <method name="FindDevice">
- <arg type="s" direction="in"/>
- <arg type="o" direction="out"/>
- </method>
- <method name="RegisterAgent">
- <arg type="o" direction="in"/>
- <arg type="s" direction="in"/>
- </method>
- <method name="UnregisterAgent">
- <arg type="o" direction="in"/>
- </method>
- <signal name="DeviceCreated">
- <arg type="o"/>
- </signal>
- <signal name="DeviceRemoved">
- <arg type="o"/>
- </signal>
- <signal name="DeviceFound">
- <arg type="s"/>
- <arg type="a{sv}"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="QVariantMap"/>
- </signal>
- <signal name="PropertyChanged">
- <arg type="s"/>
- <arg type="v"/>
- </signal>
- <signal name="DeviceDisappeared">
- <arg type="s"/>
- </signal>
- </interface>
- <interface name="org.bluez.Service">
- <method name="AddRecord">
- <arg type="s" direction="in"/>
- <arg type="u" direction="out"/>
- </method>
- <method name="UpdateRecord">
- <arg type="u" direction="in"/>
- <arg type="s" direction="in"/>
- </method>
- <method name="RemoveRecord">
- <arg type="u" direction="in"/>
- </method>
- <method name="RequestAuthorization">
- <arg type="s" direction="in"/>
- <arg type="u" direction="in"/>
- </method>
- <method name="CancelAuthorization"/>
- </interface>
- <interface name="org.bluez.SerialProxyManager">
- <method name="CreateProxy">
- <arg type="s" direction="in"/>
- <arg type="s" direction="in"/>
- <arg type="s" direction="out"/>
- </method>
- <method name="ListProxies">
- <arg type="as" direction="out"/>
- </method>
- <method name="RemoveProxy">
- <arg type="s" direction="in"/>
- </method>
- <signal name="ProxyCreated">
- <arg type="s"/>
- </signal>
- <signal name="ProxyRemoved">
- <arg type="s"/>
- </signal>
- </interface>
- <interface name="org.bluez.NetworkPeer">
- <method name="SetProperty">
- <arg type="s" direction="in"/>
- <arg type="v" direction="in"/>
- </method>
- <method name="GetProperties">
- <arg type="a{sv}" direction="out"/>
- </method>
- <signal name="PropertyChanged">
- <arg type="s"/>
- <arg type="v"/>
- </signal>
- </interface>
- <interface name="org.bluez.NetworkHub">
- <method name="SetProperty">
- <arg type="s" direction="in"/>
- <arg type="v" direction="in"/>
- </method>
- <method name="GetProperties">
- <arg type="a{sv}" direction="out"/>
- </method>
- <signal name="PropertyChanged">
- <arg type="s"/>
- <arg type="v"/>
- </signal>
- </interface>
- <interface name="org.bluez.NetworkRouter">
- <method name="SetProperty">
- <arg type="s" direction="in"/>
- <arg type="v" direction="in"/>
- </method>
- <method name="GetProperties">
- <arg type="a{sv}" direction="out"/>
- </method>
- <signal name="PropertyChanged">
- <arg type="s"/>
- <arg type="v"/>
- </signal>
- </interface>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml b/src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml
deleted file mode 100644
index 651f21a5..00000000
--- a/src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.bluez.obex.ObjectPush1">
- <method name="SendFile">
- <arg name="sourcefile" type="s" direction="in"/>
- <arg name="transfer" type="o" direction="out"/>
- <arg name="properties" type="a{sv}" direction="out"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
- </method>
- <method name="PullBusinessCard">
- <arg name="targetfile" type="s" direction="in"/>
- <arg name="transfer" type="o" direction="out"/>
- <arg name="properties" type="a{sv}" direction="out"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
- </method>
- <method name="ExchangeBusinessCards">
- <arg name="clientfile" type="s" direction="in"/>
- <arg name="targetfile" type="s" direction="in"/>
- <arg name="transfer" type="o" direction="out"/>
- <arg name="properties" type="a{sv}" direction="out"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
- </method>
- </interface>
-</node>
diff --git a/src/bluetooth/bluez/org.bluez.obex.Transfer1.xml b/src/bluetooth/bluez/org.bluez.obex.Transfer1.xml
deleted file mode 100644
index 4ee76f7d..00000000
--- a/src/bluetooth/bluez/org.bluez.obex.Transfer1.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.bluez.obex.Transfer1">
- <method name="Suspend"/>
- <method name="Resume"/>
- <method name="Cancel"/>
- <property name="Status" type="s" access="read"/>
- <property name="Name" type="s" access="read"/>
- <property name="Size" type="t" access="read"/>
- <property name="Filename" type="s" access="read"/>
- <property name="Transferred" type="t" access="read"/>
- <property name="Session" type="o" access="read"/>
- </interface>
-</node>
-
diff --git a/src/bluetooth/bluez/org.openobex.agent.xml b/src/bluetooth/bluez/org.openobex.agent.xml
deleted file mode 100644
index d21f3149..00000000
--- a/src/bluetooth/bluez/org.openobex.agent.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
-"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.openobex.Agent">
- <method name="Release">
- </method>
- <method name="Request">
- <arg type="o" direction="in"/>
- <arg type="s" direction="out"/>
- </method>
- <method name="Progress">
- <arg type="o" direction="in"/>
- <arg type="t" direction="in"/>
- </method>
- <method name="Complete">
- <arg type="o" direction="in"/>
- </method>
- <method name="Error">
- <arg type="o" direction="in"/>
- <arg type="s" direction="in"/>
- </method>
- </interface>
-</node>
-
diff --git a/src/bluetooth/bluez/org.openobex.all.xml b/src/bluetooth/bluez/org.openobex.all.xml
deleted file mode 100644
index 4e5b65b2..00000000
--- a/src/bluetooth/bluez/org.openobex.all.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
-"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/">
- <interface name="org.freedesktop.DBus.Introspectable">
- <method name="Introspect">
- <arg type="s" direction="out"/>
- </method>
- </interface>
- <interface name="org.openobex.Manager">
- <method name="RegisterAgent">
- <arg type="o" direction="in"/>
- </method>
- <method name="UnregisterAgent">
- <arg type="o" direction="in"/>
- </method>
- <signal name="TransferStarted">
- <arg type="o"/>
- </signal>
- <signal name="TransferCompleted">
- <arg type="o"/>
- <arg type="b"/>
- </signal>
- <signal name="SessionCreated">
- <arg type="o"/>
- </signal>
- <signal name="SessionRemoved">
- <arg type="o"/>
- </signal>
- </interface>
-</node>
-
diff --git a/src/bluetooth/bluez/org.openobex.client.xml b/src/bluetooth/bluez/org.openobex.client.xml
deleted file mode 100644
index fad2f6ef..00000000
--- a/src/bluetooth/bluez/org.openobex.client.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
-"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/">
- <interface name="org.freedesktop.DBus.Introspectable">
- <method name="Introspect">
- <arg type="s" direction="out"/>
- </method>
- </interface>
- <interface name="org.openobex.Client">
- <method name="SendFiles">
- <arg type="a{sv}" direction="in"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/>
- <arg type="as" direction="in"/>
- <arg type="o" direction="in"/>
- </method>
- <method name="PullBusinessCard">
- <arg type="a{sv}" direction="in"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/>
- <arg type="s" direction="in"/>
- </method>
- <method name="ExchangeBusinessCards">
- <arg type="a{sv}" direction="in"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/>
- <arg type="s" direction="in"/>
- <arg type="s" direction="in"/>
- </method>
- <method name="CreateSession">
- <arg type="a{sv}" direction="in"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/>
- <arg type="o" direction="out"/>
- </method>
- <method name="GetCapabilities">
- <arg type="a{sv}" direction="in"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/>
- <arg type="s" direction="out"/>
- </method>
- </interface>
- <node name="org"/>
-</node>
-
diff --git a/src/bluetooth/bluez/org.openobex.transfer.xml b/src/bluetooth/bluez/org.openobex.transfer.xml
deleted file mode 100644
index 21033665..00000000
--- a/src/bluetooth/bluez/org.openobex.transfer.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
-"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/">
- <interface name="org.freedesktop.DBus.Introspectable">
- <method name="Introspect">
- <arg type="s" direction="out"/>
- </method>
- </interface>
- <interface name="org.openobex.Transfer">
- <method name="GetProperties">
- <arg type="a{sv}" direction="out"/>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
- </method>
- <method name="Cancel">
- </method>
- </interface>
- <node name="org"/>
-</node>
-
diff --git a/src/bluetooth/bluez/profile1.cpp b/src/bluetooth/bluez/profile1.cpp
index e74be807..7e67cf29 100644
--- a/src/bluetooth/bluez/profile1.cpp
+++ b/src/bluetooth/bluez/profile1.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p profile1_p.h:profile1.cpp org.bluez.Profile1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p profile1_p.h:profile1.cpp org.bluez.Profile1.xml
*
- * qdbusxml2cpp is Copyright (C) 2018 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezProfile1Interface::~OrgBluezProfile1Interface()
{
}
+
+#include "moc_profile1_p.cpp"
diff --git a/src/bluetooth/bluez/profile1_p.h b/src/bluetooth/bluez/profile1_p.h
index 63ea40b8..bf263545 100644
--- a/src/bluetooth/bluez/profile1_p.h
+++ b/src/bluetooth/bluez/profile1_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p profile1_p.h:profile1.cpp org.bluez.Profile1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p profile1_p.h:profile1.cpp org.bluez.Profile1.xml
*
- * qdbusxml2cpp is Copyright (C) 2018 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef PROFILE1_P_H
#define PROFILE1_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.Profile1
@@ -61,7 +73,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezProfile1Interface Profile1;
+ using Profile1 = ::OrgBluezProfile1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/profile1context.cpp b/src/bluetooth/bluez/profile1context.cpp
index 5eeec56a..3bb7e1bd 100644
--- a/src/bluetooth/bluez/profile1context.cpp
+++ b/src/bluetooth/bluez/profile1context.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "profile1context_p.h"
@@ -70,3 +34,5 @@ void OrgBluezProfile1ContextInterface::Release()
}
QT_END_NAMESPACE
+
+#include "moc_profile1context_p.cpp"
diff --git a/src/bluetooth/bluez/profile1context_p.h b/src/bluetooth/bluez/profile1context_p.h
index bd7b7df3..99160bba 100644
--- a/src/bluetooth/bluez/profile1context_p.h
+++ b/src/bluetooth/bluez/profile1context_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PROFILECONTEXT_P_H
#define PROFILECONTEXT_P_H
@@ -55,6 +19,7 @@
#include <QtDBus/qdbuscontext.h>
#include <QtDBus/qdbusextratypes.h>
#include <QtDBus/qdbusunixfiledescriptor.h>
+#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/bluez/profilemanager1.cpp b/src/bluetooth/bluez/profilemanager1.cpp
index fe685c63..4366a968 100644
--- a/src/bluetooth/bluez/profilemanager1.cpp
+++ b/src/bluetooth/bluez/profilemanager1.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p profilemanager1_p.h:profilemanager1.cpp org.bluez.ProfileManager1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p profilemanager1_p.h:profilemanager1.cpp org.bluez.ProfileManager1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgBluezProfileManager1Interface::~OrgBluezProfileManager1Interface()
{
}
+
+#include "moc_profilemanager1_p.cpp"
diff --git a/src/bluetooth/bluez/profilemanager1_p.h b/src/bluetooth/bluez/profilemanager1_p.h
index 5530783b..a02af3b6 100644
--- a/src/bluetooth/bluez/profilemanager1_p.h
+++ b/src/bluetooth/bluez/profilemanager1_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p profilemanager1_p.h:profilemanager1.cpp org.bluez.ProfileManager1.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p profilemanager1_p.h:profilemanager1.cpp org.bluez.ProfileManager1.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef PROFILEMANAGER1_P_H
#define PROFILEMANAGER1_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.bluez.ProfileManager1
@@ -55,7 +67,7 @@ Q_SIGNALS: // SIGNALS
namespace org {
namespace bluez {
- typedef ::OrgBluezProfileManager1Interface ProfileManager1;
+ using ProfileManager1 = ::OrgBluezProfileManager1Interface;
}
}
#endif
diff --git a/src/bluetooth/bluez/properties.cpp b/src/bluetooth/bluez/properties.cpp
index 1c10bfdc..0725d58f 100644
--- a/src/bluetooth/bluez/properties.cpp
+++ b/src/bluetooth/bluez/properties.cpp
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p properties_p.h:properties.cpp org.freedesktop.dbus.properties.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p properties_p.h:properties.cpp org.freedesktop.dbus.properties.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -24,3 +24,5 @@ OrgFreedesktopDBusPropertiesInterface::~OrgFreedesktopDBusPropertiesInterface()
{
}
+
+#include "moc_properties_p.cpp"
diff --git a/src/bluetooth/bluez/properties_p.h b/src/bluetooth/bluez/properties_p.h
index 16a43e80..83286526 100644
--- a/src/bluetooth/bluez/properties_p.h
+++ b/src/bluetooth/bluez/properties_p.h
@@ -1,8 +1,8 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p properties_p.h:properties.cpp org.freedesktop.dbus.properties.xml
+ * Command line was: qdbusxml2cpp -I QtCore/private/qglobal_p.h -p properties_p.h:properties.cpp org.freedesktop.dbus.properties.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,6 +11,17 @@
#ifndef PROPERTIES_P_H
#define PROPERTIES_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -19,6 +30,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include <QtCore/private/qglobal_p.h>
/*
* Proxy class for interface org.freedesktop.DBus.Properties
@@ -58,13 +70,14 @@ public Q_SLOTS: // METHODS
}
Q_SIGNALS: // SIGNALS
- void PropertiesChanged(const QString &interface, const QVariantMap &changed_properties, const QStringList &invalidated_properties);
+ void PropertiesChanged(const QString &interface, const QVariantMap &changed_properties, const QStringList &invalidated_properties,
+ const QDBusMessage &msg);
};
namespace org {
namespace freedesktop {
namespace DBus {
- typedef ::OrgFreedesktopDBusPropertiesInterface Properties;
+ using Properties = ::OrgFreedesktopDBusPropertiesInterface;
}
}
}
diff --git a/src/bluetooth/bluez/propertiesadaptor.cpp b/src/bluetooth/bluez/propertiesadaptor.cpp
new file mode 100644
index 00000000..177f839f
--- /dev/null
+++ b/src/bluetooth/bluez/propertiesadaptor.cpp
@@ -0,0 +1,56 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a propertiesadaptor_p.h:propertiesadaptor.cpp -c OrgFreedesktopDBusPropertiesAdaptor -i bluez5_helper_p.h org.freedesktop.dbus.properties.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "propertiesadaptor_p.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class OrgFreedesktopDBusPropertiesAdaptor
+ */
+
+OrgFreedesktopDBusPropertiesAdaptor::OrgFreedesktopDBusPropertiesAdaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+OrgFreedesktopDBusPropertiesAdaptor::~OrgFreedesktopDBusPropertiesAdaptor()
+{
+ // destructor
+}
+
+QDBusVariant OrgFreedesktopDBusPropertiesAdaptor::Get(const QString &interface, const QString &name)
+{
+ // handle method call org.freedesktop.DBus.Properties.Get
+ QDBusVariant value;
+ QMetaObject::invokeMethod(parent(), "Get", Q_RETURN_ARG(QDBusVariant, value), Q_ARG(QString, interface), Q_ARG(QString, name));
+ return value;
+}
+
+QVariantMap OrgFreedesktopDBusPropertiesAdaptor::GetAll(const QString &interface)
+{
+ // handle method call org.freedesktop.DBus.Properties.GetAll
+ QVariantMap properties;
+ QMetaObject::invokeMethod(parent(), "GetAll", Q_RETURN_ARG(QVariantMap, properties), Q_ARG(QString, interface));
+ return properties;
+}
+
+void OrgFreedesktopDBusPropertiesAdaptor::Set(const QString &interface, const QString &name, const QDBusVariant &value)
+{
+ // handle method call org.freedesktop.DBus.Properties.Set
+ QMetaObject::invokeMethod(parent(), "Set", Q_ARG(QString, interface), Q_ARG(QString, name), Q_ARG(QDBusVariant, value));
+}
diff --git a/src/bluetooth/bluez/propertiesadaptor_p.h b/src/bluetooth/bluez/propertiesadaptor_p.h
new file mode 100644
index 00000000..1be0fd0f
--- /dev/null
+++ b/src/bluetooth/bluez/propertiesadaptor_p.h
@@ -0,0 +1,76 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp -a propertiesadaptor_p.h:propertiesadaptor.cpp -c OrgFreedesktopDBusPropertiesAdaptor -i bluez5_helper_p.h org.freedesktop.dbus.properties.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef PROPERTIESADAPTOR_P_H
+#define PROPERTIESADAPTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "bluez5_helper_p.h"
+#include <QtCore/qcontainerfwd.h>
+
+/*
+ * Adaptor class for interface org.freedesktop.DBus.Properties
+ */
+class OrgFreedesktopDBusPropertiesAdaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.freedesktop.DBus.Properties")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.freedesktop.DBus.Properties\">\n"
+" <method name=\"Get\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"interface\"/>\n"
+" <arg direction=\"in\" type=\"s\" name=\"name\"/>\n"
+" <arg direction=\"out\" type=\"v\" name=\"value\"/>\n"
+" </method>\n"
+" <method name=\"Set\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"interface\"/>\n"
+" <arg direction=\"in\" type=\"s\" name=\"name\"/>\n"
+" <arg direction=\"in\" type=\"v\" name=\"value\"/>\n"
+" </method>\n"
+" <method name=\"GetAll\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"interface\"/>\n"
+" <arg direction=\"out\" type=\"a{sv}\" name=\"properties\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
+" </method>\n"
+" <signal name=\"PropertiesChanged\">\n"
+" <arg type=\"s\" name=\"interface\"/>\n"
+" <arg type=\"a{sv}\" name=\"changed_properties\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"org.qtproject.QtDBus.QtTypeName.Out1\"/>\n"
+" <arg type=\"as\" name=\"invalidated_properties\"/>\n"
+" </signal>\n"
+" </interface>\n"
+ "")
+public:
+ OrgFreedesktopDBusPropertiesAdaptor(QObject *parent);
+ virtual ~OrgFreedesktopDBusPropertiesAdaptor();
+
+public: // PROPERTIES
+public Q_SLOTS: // METHODS
+ QDBusVariant Get(const QString &interface, const QString &name);
+ QVariantMap GetAll(const QString &interface);
+ void Set(const QString &interface, const QString &name, const QDBusVariant &value);
+Q_SIGNALS: // SIGNALS
+ void PropertiesChanged(const QString &interface, const QVariantMap &changed_properties, const QStringList &invalidated_properties);
+};
+
+#endif
diff --git a/src/bluetooth/bluez/remotedevicemanager.cpp b/src/bluetooth/bluez/remotedevicemanager.cpp
index 5d17d571..e8b13ce2 100644
--- a/src/bluetooth/bluez/remotedevicemanager.cpp
+++ b/src/bluetooth/bluez/remotedevicemanager.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/QLoggingCategory>
@@ -58,8 +22,7 @@ RemoteDeviceManager::RemoteDeviceManager(
const QBluetoothAddress &address, QObject *parent)
: QObject(parent), localAddress(address)
{
- if (!isBluez5())
- return;
+ initializeBluez5();
bool ok = false;
adapterPath = findAdapterForAddress(address, &ok);
@@ -68,8 +31,7 @@ RemoteDeviceManager::RemoteDeviceManager(
}
}
-bool RemoteDeviceManager::scheduleJob(
- JobType job, const QVector<QBluetoothAddress> &remoteDevices)
+bool RemoteDeviceManager::scheduleJob(JobType job, const QList<QBluetoothAddress> &remoteDevices)
{
if (adapterPath.isEmpty())
return false;
@@ -106,7 +68,7 @@ void RemoteDeviceManager::prepareNextJob()
jobQueue.pop_front();
jobInProgress = false;
- qDebug(QT_BT_BLUEZ) << "RemoteDeviceManager job queue status:" << jobQueue.empty();
+ qCDebug(QT_BT_BLUEZ) << "RemoteDeviceManager job queue status:" << jobQueue.empty();
if (jobQueue.empty())
emit finished();
else
@@ -165,9 +127,11 @@ void RemoteDeviceManager::disconnectDevice(const QBluetoothAddress &remote)
}
if (!jobStarted) {
- qDebug(QT_BT_BLUEZ) << "RemoteDeviceManager JobDisconnectDevice failed";
+ qCDebug(QT_BT_BLUEZ) << "RemoteDeviceManager JobDisconnectDevice failed";
QTimer::singleShot(0, this, [this](){ prepareNextJob(); });
}
}
QT_END_NAMESPACE
+
+#include "moc_remotedevicemanager_p.cpp"
diff --git a/src/bluetooth/bluez/remotedevicemanager_p.h b/src/bluetooth/bluez/remotedevicemanager_p.h
index d177d74e..a41b1452 100644
--- a/src/bluetooth/bluez/remotedevicemanager_p.h
+++ b/src/bluetooth/bluez/remotedevicemanager_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef REMOTEDEVICEMANAGER_P_H
#define REMOTEDEVICEMANAGER_P_H
@@ -53,11 +17,12 @@
#include <deque>
+#include <QList>
#include <QMutex>
#include <QObject>
-#include <QVector>
#include <QtBluetooth/qbluetoothaddress.h>
+#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
@@ -76,7 +41,7 @@ public:
explicit RemoteDeviceManager(const QBluetoothAddress& localAddress, QObject *parent = nullptr);
bool isJobInProgress() const { return jobInProgress; }
- bool scheduleJob(JobType job, const QVector<QBluetoothAddress>& remoteDevices);
+ bool scheduleJob(JobType job, const QList<QBluetoothAddress> &remoteDevices);
signals:
void finished();
diff --git a/src/bluetooth/bluez/service.cpp b/src/bluetooth/bluez/service.cpp
deleted file mode 100644
index d2b15fc2..00000000
--- a/src/bluetooth/bluez/service.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p service_p.h:service.cpp org.bluez.all.xml org.bluez.Service
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "service_p.h"
-
-/*
- * Implementation of interface class OrgBluezServiceInterface
- */
-
-OrgBluezServiceInterface::OrgBluezServiceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgBluezServiceInterface::~OrgBluezServiceInterface()
-{
-}
-
diff --git a/src/bluetooth/bluez/service_p.h b/src/bluetooth/bluez/service_p.h
deleted file mode 100644
index 573265a8..00000000
--- a/src/bluetooth/bluez/service_p.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -p service_p.h:service.cpp org.bluez.all.xml org.bluez.Service
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef SERVICE_P_H
-#define SERVICE_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.Service
- */
-class OrgBluezServiceInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.bluez.Service"; }
-
-public:
- OrgBluezServiceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
- ~OrgBluezServiceInterface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<uint> AddRecord(const QString &in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("AddRecord"), argumentList);
- }
-
- inline QDBusPendingReply<> CancelAuthorization()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("CancelAuthorization"), argumentList);
- }
-
- inline QDBusPendingReply<> RemoveRecord(uint in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("RemoveRecord"), argumentList);
- }
-
- inline QDBusPendingReply<> RequestAuthorization(const QString &in0, uint in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("RequestAuthorization"), argumentList);
- }
-
- inline QDBusPendingReply<> UpdateRecord(uint in0, const QString &in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("UpdateRecord"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace bluez {
- typedef ::OrgBluezServiceInterface Service;
- }
-}
-#endif
diff --git a/src/bluetooth/bluez/servicemap.cpp b/src/bluetooth/bluez/servicemap.cpp
index 46616cbe..8a8b6f44 100644
--- a/src/bluetooth/bluez/servicemap.cpp
+++ b/src/bluetooth/bluez/servicemap.cpp
@@ -1,44 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "servicemap_p.h"
+QT_BEGIN_NAMESPACE
+
+QT_IMPL_METATYPE_EXTERN(ServiceMap)
+
const QDBusArgument &operator>>(const QDBusArgument &argument, ServiceMap &serviceMap)
{
argument.beginMap();
@@ -59,3 +27,5 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ServiceMap &servi
return argument;
}
+
+QT_END_NAMESPACE
diff --git a/src/bluetooth/bluez/servicemap_p.h b/src/bluetooth/bluez/servicemap_p.h
index 572c2790..773f9d0e 100644
--- a/src/bluetooth/bluez/servicemap_p.h
+++ b/src/bluetooth/bluez/servicemap_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef SERVICEMAP_P_H
#define SERVICEMAP_P_H
@@ -51,14 +15,21 @@
// We mean it.
//
+#include <QtBluetooth/qtbluetoothglobal.h>
+
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtDBus/QDBusArgument>
+#include <QtCore/private/qglobal_p.h>
+
+QT_BEGIN_NAMESPACE
typedef QMap<quint32, QString> ServiceMap;
const QDBusArgument &operator>>(const QDBusArgument &argument, ServiceMap &serviceMap);
-Q_DECLARE_METATYPE(ServiceMap)
+QT_END_NAMESPACE
+
+QT_DECL_METATYPE_EXTERN(ServiceMap, Q_BLUETOOTH_EXPORT)
#endif // SERVICEMAP_P_H