Debian Codegraph @

autotests/fakebluez/gattcharacteristicinterface.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 GATTCHARACTERISTICINTERFACE_H
8 #define GATTCHARACTERISTICINTERFACE_H
9
10 #include "object.h"
11
12 #include <QDBusAbstractAdaptor>
13 #include <QStringList>
14
15 class QDBusObjectPath;
16
17 class GattCharacteristicObject : public QObject
18 {
19 public:
20 explicit GattCharacteristicObject(const QDBusObjectPath &path, QObject *parent = nullptr);
21 };
22
23 class GattCharacteristicInterface : public QDBusAbstractAdaptor, public Object
24 {
25 Q_OBJECT
26 Q_CLASSINFO("D-Bus Interface", "org.bluez.GattCharacteristic1")
27 Q_PROPERTY(QString UUID READ UUID)
28 Q_PROPERTY(QDBusObjectPath Service READ service)
29 Q_PROPERTY(QByteArray Value READ value)
30 Q_PROPERTY(bool Notifying READ notifying)
31 Q_PROPERTY(QStringList Flags READ flags)
32 Q_PROPERTY(quint16 Handle READ handle WRITE setHandle)
33 Q_PROPERTY(quint16 MTU READ MTU)
34
35 public:
36 explicit GattCharacteristicInterface(const QDBusObjectPath &path, const QVariantMap &properties, QObject *parent = nullptr);
37
38 QString UUID() const;
39
40 QDBusObjectPath service() const;
41
42 QByteArray value() const;
43
44 bool notifying() const;
45
46 QStringList flags() const;
47
48 quint16 handle() const;
49 void setHandle(const quint16 handle);
50
51 quint16 MTU() const;
52
53 public Q_SLOTS:
54 QByteArray ReadValue(const QVariantMap& options);
55 void WriteValue(const QByteArray& value, const QVariantMap& options);
56 void StartNotify();
57 void StopNotify();
58
59 private:
60
61 friend class DeviceManager;
62 };
63
64 #endif // GATTCHARACTERISTICINTERFACE_H