diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2022-10-28 14:35:05 +0300 |
---|---|---|
committer | Juha Vuolle <juha.vuolle@insta.fi> | 2022-12-07 11:47:23 +0200 |
commit | ee421fdeb7eb36d4d063248a995585c80ce2b2b9 (patch) | |
tree | ceef9fa7cd97d7b086c8076650d1192eb40bd520 | |
parent | b8a3a97ea9324b8501ef341b51d776c3ac8dbbd3 (diff) | |
download | qtconnectivity-ee421fdeb7eb36d4d063248a995585c80ce2b2b9.tar.gz |
Add Bluez DBus peripheral role XML definitions
A preparatory task for implementing Bluez DBus peripheral role support.
This commit introduces the bulk of the needed interfaces; further
manual adjustments are likely needed in the followup commits.
Fixes: QTBUG-107506
Change-Id: I5152002746db3b6ffc20981f34a34bbe13880b2f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | src/bluetooth/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/bluetooth/bluez/gattmanager1.cpp | 28 | ||||
-rw-r--r-- | src/bluetooth/bluez/gattmanager1_p.h | 73 | ||||
-rwxr-xr-x | src/bluetooth/bluez/generate | 2 | ||||
-rw-r--r-- | src/bluetooth/bluez/leadvertisement1.cpp | 101 | ||||
-rw-r--r-- | src/bluetooth/bluez/leadvertisement1_p.h | 82 | ||||
-rw-r--r-- | src/bluetooth/bluez/leadvertisingmanager1.cpp | 28 | ||||
-rw-r--r-- | src/bluetooth/bluez/leadvertisingmanager1_p.h | 85 | ||||
-rw-r--r-- | src/bluetooth/bluez/org.bluez.GattManager1.xml | 14 | ||||
-rw-r--r-- | src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml | 28 | ||||
-rw-r--r-- | src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml | 18 |
11 files changed, 462 insertions, 0 deletions
diff --git a/src/bluetooth/CMakeLists.txt b/src/bluetooth/CMakeLists.txt index 20e20632..91c384d8 100644 --- a/src/bluetooth/CMakeLists.txt +++ b/src/bluetooth/CMakeLists.txt @@ -75,6 +75,9 @@ if(QT_FEATURE_bluez) bluez/properties.cpp bluez/properties_p.h bluez/remotedevicemanager.cpp bluez/remotedevicemanager_p.h bluez/servicemap.cpp bluez/servicemap_p.h + bluez/gattmanager1.cpp bluez/gattmanager1_p.h + bluez/leadvertisement1.cpp bluez/leadvertisement1_p.h + bluez/leadvertisingmanager1.cpp bluez/leadvertisingmanager1_p.h qbluetoothdevicediscoveryagent_bluez.cpp qbluetoothlocaldevice_bluez.cpp qbluetoothserver_bluez.cpp 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/generate b/src/bluetooth/bluez/generate index 1da1fc50..f009f232 100755 --- a/src/bluetooth/bluez/generate +++ b/src/bluetooth/bluez/generate @@ -27,3 +27,5 @@ 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/leadvertisement1.cpp b/src/bluetooth/bluez/leadvertisement1.cpp new file mode 100644 index 00000000..065d67a9 --- /dev/null +++ b/src/bluetooth/bluez/leadvertisement1.cpp @@ -0,0 +1,101 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -a leadvertisement1_p.h:leadvertisement1.cpp -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 LEAdvertisement1Adaptor + */ + +LEAdvertisement1Adaptor::LEAdvertisement1Adaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +LEAdvertisement1Adaptor::~LEAdvertisement1Adaptor() +{ + // destructor +} + +QStringList LEAdvertisement1Adaptor::includes() const +{ + // get the value of property Includes + return qvariant_cast< QStringList >(parent()->property("Includes")); +} + +void LEAdvertisement1Adaptor::setIncludes(const QStringList &value) +{ + // set the value of property Includes + parent()->setProperty("Includes", QVariant::fromValue(value)); +} + +QString LEAdvertisement1Adaptor::localName() const +{ + // get the value of property LocalName + return qvariant_cast< QString >(parent()->property("LocalName")); +} + +void LEAdvertisement1Adaptor::setLocalName(const QString &value) +{ + // set the value of property LocalName + parent()->setProperty("LocalName", QVariant::fromValue(value)); +} + +ManufacturerDataList LEAdvertisement1Adaptor::manufacturerData() const +{ + // get the value of property ManufacturerData + return qvariant_cast< ManufacturerDataList >(parent()->property("ManufacturerData")); +} + +void LEAdvertisement1Adaptor::setManufacturerData(ManufacturerDataList value) +{ + // set the value of property ManufacturerData + parent()->setProperty("ManufacturerData", QVariant::fromValue(value)); +} + +QStringList LEAdvertisement1Adaptor::serviceUUIDs() const +{ + // get the value of property ServiceUUIDs + return qvariant_cast< QStringList >(parent()->property("ServiceUUIDs")); +} + +void LEAdvertisement1Adaptor::setServiceUUIDs(const QStringList &value) +{ + // set the value of property ServiceUUIDs + parent()->setProperty("ServiceUUIDs", QVariant::fromValue(value)); +} + +QString LEAdvertisement1Adaptor::type() const +{ + // get the value of property Type + return qvariant_cast< QString >(parent()->property("Type")); +} + +void LEAdvertisement1Adaptor::setType(const QString &value) +{ + // set the value of property Type + parent()->setProperty("Type", QVariant::fromValue(value)); +} + +void LEAdvertisement1Adaptor::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..b7b5ab2d --- /dev/null +++ b/src/bluetooth/bluez/leadvertisement1_p.h @@ -0,0 +1,82 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -a leadvertisement1_p.h:leadvertisement1.cpp -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 LEAdvertisement1Adaptor: 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=\"as\" name=\"Includes\"/>\n" +" <property access=\"readwrite\" type=\"s\" name=\"LocalName\"/>\n" +" </interface>\n" + "") +public: + LEAdvertisement1Adaptor(QObject *parent); + virtual ~LEAdvertisement1Adaptor(); + +public: // PROPERTIES + 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(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/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..91f94b7a --- /dev/null +++ b/src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml @@ -0,0 +1,28 @@ +<!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 --> + <!-- Discoverable --> + <!-- DiscoverableTimeout --> + <property name="Includes" type="as" access="readwrite"/> + <property name="LocalName" type="s" access="readwrite"/> + <!-- Appearance --> + <!-- Duration --> + <!-- Timeout --> + <!-- SecondaryChannel --> + <!-- MinInterval --> + <!-- MaxInterval --> + <!-- TxPower --> + </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..5ebec678 --- /dev/null +++ b/src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml @@ -0,0 +1,18 @@ +<!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 --> + </interface> +</node> |