Debian Codegraph @

autotests/fakebluez/gattdescriptorinterface.h

raw
1 /*
2 * SPDX-FileCopyrightText: 2021 Ivan Podkurkov <[email protected]>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6
7 #ifndef GATTDESCRIPTORINTERFACE_H
8 #define GATTDESCRIPTORINTERFACE_H
9
10 #include "object.h"
11
12 #include <QDBusAbstractAdaptor>
13 #include <QStringList>
14
15 class QDBusObjectPath;
16
17 class GattDescriptorObject : public QObject
18 {
19 public:
20 explicit GattDescriptorObject(const QDBusObjectPath &path, QObject *parent = nullptr);
21 };
22
23 class GattDescriptorInterface : public QDBusAbstractAdaptor, public Object
24 {
25 Q_OBJECT
26 Q_CLASSINFO("D-Bus Interface", "org.bluez.GattDescriptor1")
27 Q_PROPERTY(QString UUID READ UUID)
28 Q_PROPERTY(QDBusObjectPath Characteristic READ characteristic)
29 Q_PROPERTY(QByteArray Value READ value)
30 Q_PROPERTY(QStringList Flags READ flags)
31 Q_PROPERTY(quint16 Handle READ handle WRITE setHandle)
32
33 public:
34 explicit GattDescriptorInterface(const QDBusObjectPath &path, const QVariantMap &properties, QObject *parent = nullptr);
35
36 QString UUID() const;
37
38 QDBusObjectPath characteristic() const;
39
40 QByteArray value() const;
41
42 QStringList flags() const;
43
44 quint16 handle() const;
45 void setHandle(const quint16 handle);
46
47 public Q_SLOTS:
48 QByteArray ReadValue(const QVariantMap& options);
49 void WriteValue(const QByteArray& value, const QVariantMap& options);
50
51 private:
52
53 friend class DeviceManager;
54 };
55
56 #endif // GATTDESCRIPTORINTERFACE_H