Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
gattcharacteristic1adaptor.cpp
Go to the documentation of this file.
1/*
2 * This file was generated by qdbusxml2cpp version 0.8
3 * Source file was org.bluez.GattCharacteristic1.xml
4 *
5 * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors.
6 *
7 * This is an auto-generated file.
8 * Do not edit! All changes made to it will be lost.
9 */
10
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
20namespace QtBluetoothPrivate {
21
22/*
23 * Implementation of adaptor class OrgBluezGattCharacteristic1Adaptor
24 */
25
26OrgBluezGattCharacteristic1Adaptor::OrgBluezGattCharacteristic1Adaptor(QObject *parent)
27 : QDBusAbstractAdaptor(parent)
28{
29 // constructor
30 setAutoRelaySignals(true);
31}
32
33OrgBluezGattCharacteristic1Adaptor::~OrgBluezGattCharacteristic1Adaptor()
34{
35 // destructor
36}
37
38QStringList OrgBluezGattCharacteristic1Adaptor::flags() const
39{
40 // get the value of property Flags
41 return qvariant_cast< QStringList >(parent()->property("Flags"));
42}
43
44bool OrgBluezGattCharacteristic1Adaptor::notifying() const
45{
46 // get the value of property Notifying
47 return qvariant_cast< bool >(parent()->property("Notifying"));
48}
49
50QDBusObjectPath OrgBluezGattCharacteristic1Adaptor::service() const
51{
52 // get the value of property Service
53 return qvariant_cast< QDBusObjectPath >(parent()->property("Service"));
54}
55
56QString OrgBluezGattCharacteristic1Adaptor::uUID() const
57{
58 // get the value of property UUID
59 return qvariant_cast< QString >(parent()->property("UUID"));
60}
61
62QByteArray OrgBluezGattCharacteristic1Adaptor::value() const
63{
64 // get the value of property Value
65 return qvariant_cast< QByteArray >(parent()->property("Value"));
66}
67
68QByteArray OrgBluezGattCharacteristic1Adaptor::ReadValue(const QVariantMap &options,
69 const QDBusMessage& msg)
70{
71 // handle method call org.bluez.GattCharacteristic1.ReadValue
72 QByteArray value;
73 QString error;
74 QMetaObject::invokeMethod(parent(), "ReadValue", Q_RETURN_ARG(QByteArray, value),
75 Q_ARG(QVariantMap, options), Q_ARG(QString&, error));
76 if (!error.isEmpty()) {
77 // Reply with error if needed
78 auto reply = msg.createErrorReply(error, {});
79 QDBusConnection::systemBus().send(reply);
80 }
81 return value;
82}
83
84void OrgBluezGattCharacteristic1Adaptor::StartNotify()
85{
86 // handle method call org.bluez.GattCharacteristic1.StartNotify
87 QMetaObject::invokeMethod(parent(), "StartNotify");
88}
89
90void OrgBluezGattCharacteristic1Adaptor::StopNotify()
91{
92 // handle method call org.bluez.GattCharacteristic1.StopNotify
93 QMetaObject::invokeMethod(parent(), "StopNotify");
94}
95
96void OrgBluezGattCharacteristic1Adaptor::WriteValue(const QByteArray &value,
97 const QVariantMap &options,
98 const QDBusMessage& msg)
99{
100 // handle method call org.bluez.GattCharacteristic1.WriteValue
101 QString error;
102 QMetaObject::invokeMethod(parent(), "WriteValue", Q_RETURN_ARG(QString, error),
103 Q_ARG(QByteArray, value), Q_ARG(QVariantMap, options));
104
105 if (!error.isEmpty()) {
106 // Reply with error if needed
107 auto reply = msg.createErrorReply(error, {});
108 QDBusConnection::systemBus().send(reply);
109 }
110}
111
112} // end of namespace QtBluetoothPrivate