From ee421fdeb7eb36d4d063248a995585c80ce2b2b9 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Fri, 28 Oct 2022 14:35:05 +0300 Subject: 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 Reviewed-by: Alex Blasche --- src/bluetooth/CMakeLists.txt | 3 + src/bluetooth/bluez/gattmanager1.cpp | 28 ++++++ src/bluetooth/bluez/gattmanager1_p.h | 73 +++++++++++++++ src/bluetooth/bluez/generate | 2 + src/bluetooth/bluez/leadvertisement1.cpp | 101 +++++++++++++++++++++ src/bluetooth/bluez/leadvertisement1_p.h | 82 +++++++++++++++++ src/bluetooth/bluez/leadvertisingmanager1.cpp | 28 ++++++ src/bluetooth/bluez/leadvertisingmanager1_p.h | 85 +++++++++++++++++ src/bluetooth/bluez/org.bluez.GattManager1.xml | 14 +++ src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml | 28 ++++++ .../bluez/org.bluez.LEAdvertisingManager1.xml | 18 ++++ 11 files changed, 462 insertions(+) create mode 100644 src/bluetooth/bluez/gattmanager1.cpp create mode 100644 src/bluetooth/bluez/gattmanager1_p.h create mode 100644 src/bluetooth/bluez/leadvertisement1.cpp create mode 100644 src/bluetooth/bluez/leadvertisement1_p.h create mode 100644 src/bluetooth/bluez/leadvertisingmanager1.cpp create mode 100644 src/bluetooth/bluez/leadvertisingmanager1_p.h create mode 100644 src/bluetooth/bluez/org.bluez.GattManager1.xml create mode 100644 src/bluetooth/bluez/org.bluez.LEAdvertisement1.xml create mode 100644 src/bluetooth/bluez/org.bluez.LEAdvertisingManager1.xml 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 +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * 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 argumentList; + argumentList << QVariant::fromValue(application) << QVariant::fromValue(options); + return asyncCallWithArgumentList(QStringLiteral("RegisterApplication"), argumentList); + } + + inline QDBusPendingReply<> UnregisterApplication(const QDBusObjectPath &application) + { + QList 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 +#include +#include +#include +#include +#include +#include + +/* + * 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 +#include +#include "bluez5_helper_p.h" +#include + +/* + * 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", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \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 +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * 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 argumentList; + argumentList << QVariant::fromValue(advertisement) << QVariant::fromValue(options); + return asyncCallWithArgumentList(QStringLiteral("RegisterAdvertisement"), argumentList); + } + + inline QDBusPendingReply<> UnregisterAdvertisement(const QDBusObjectPath &advertisement) + { + QList 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 @@ + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.1