| 1 | /* | 
| 2 |  * This file was generated by qdbusxml2cpp version 0.8 | 
| 3 |  * Command line was: qdbusxml2cpp -a gattdescriptor1adaptor_p.h:gattdescriptor1adaptor.cpp -c OrgBluezGattDescriptor1Adaptor -i bluez5_helper_p.h org.bluez.GattDescriptor1.xml | 
| 4 |  * | 
| 5 |  * qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd. | 
| 6 |  * | 
| 7 |  * This is an auto-generated file. | 
| 8 |  * Do not edit! All changes made to it will be lost. | 
| 9 |  */ | 
| 10 |  | 
| 11 | #include "gattdescriptor1adaptor_p.h" | 
| 12 | #include <QtCore/QMetaObject> | 
| 13 | #include <QtCore/QByteArray> | 
| 14 | #include <QtCore/QList> | 
| 15 | #include <QtCore/QMap> | 
| 16 | #include <QtCore/QString> | 
| 17 | #include <QtCore/QStringList> | 
| 18 | #include <QtCore/QVariant> | 
| 19 |  | 
| 20 | /* | 
| 21 |  * Implementation of adaptor class OrgBluezGattDescriptor1Adaptor | 
| 22 |  */ | 
| 23 |  | 
| 24 | OrgBluezGattDescriptor1Adaptor::OrgBluezGattDescriptor1Adaptor(QObject *parent) | 
| 25 |     : QDBusAbstractAdaptor(parent) | 
| 26 | { | 
| 27 |     // constructor | 
| 28 |     setAutoRelaySignals(true); | 
| 29 | } | 
| 30 |  | 
| 31 | OrgBluezGattDescriptor1Adaptor::~OrgBluezGattDescriptor1Adaptor() | 
| 32 | { | 
| 33 |     // destructor | 
| 34 | } | 
| 35 |  | 
| 36 | QDBusObjectPath OrgBluezGattDescriptor1Adaptor::characteristic() const | 
| 37 | { | 
| 38 |     // get the value of property Characteristic | 
| 39 |     return qvariant_cast< QDBusObjectPath >(v: parent()->property(name: "Characteristic" )); | 
| 40 | } | 
| 41 |  | 
| 42 | QString OrgBluezGattDescriptor1Adaptor::uUID() const | 
| 43 | { | 
| 44 |     // get the value of property UUID | 
| 45 |     return qvariant_cast< QString >(v: parent()->property(name: "UUID" )); | 
| 46 | } | 
| 47 |  | 
| 48 | QByteArray OrgBluezGattDescriptor1Adaptor::value() const | 
| 49 | { | 
| 50 |     // get the value of property Value | 
| 51 |     return qvariant_cast< QByteArray >(v: parent()->property(name: "Value" )); | 
| 52 | } | 
| 53 |  | 
| 54 | QByteArray OrgBluezGattDescriptor1Adaptor::ReadValue(const QVariantMap &options, | 
| 55 |                                                      const QDBusMessage& msg) | 
| 56 | { | 
| 57 |     // handle method call org.bluez.GattDescriptor1.ReadValue | 
| 58 |     QByteArray value; | 
| 59 |     QString error; | 
| 60 |     QMetaObject::invokeMethod(obj: parent(), member: "ReadValue" , Q_RETURN_ARG(QByteArray, value), | 
| 61 |                               Q_ARG(QVariantMap, options), Q_ARG(QString&, error)); | 
| 62 |     if (!error.isEmpty()) { | 
| 63 |         // Reply with error if needed | 
| 64 |         auto reply = msg.createErrorReply(name: error, msg: {}); | 
| 65 |         QDBusConnection::systemBus().send(message: reply); | 
| 66 |     } | 
| 67 |     return value; | 
| 68 | } | 
| 69 |  | 
| 70 | void OrgBluezGattDescriptor1Adaptor::WriteValue(const QByteArray &value, | 
| 71 |                                                 const QVariantMap &options, | 
| 72 |                                                 const QDBusMessage& msg) | 
| 73 | { | 
| 74 |     // handle method call org.bluez.GattDescriptor1.WriteValue | 
| 75 |     QString error; | 
| 76 |     QMetaObject::invokeMethod(obj: parent(), member: "WriteValue" , Q_RETURN_ARG(QString, error), | 
| 77 |                               Q_ARG(QByteArray, value), Q_ARG(QVariantMap, options)); | 
| 78 |  | 
| 79 |     if (!error.isEmpty()) { | 
| 80 |         // Reply with error if needed | 
| 81 |         auto reply = msg.createErrorReply(name: error, msg: {}); | 
| 82 |         QDBusConnection::systemBus().send(message: reply); | 
| 83 |     } | 
| 84 | } | 
| 85 |  |