File indexing completed on 2024-05-05 03:52:29

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2022 Pontus Sjögren
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef GATTDESCRIPTORADAPTOR_H
0010 #define GATTDESCRIPTORADAPTOR_H
0011 
0012 #include <QObject>
0013 #include <QStringList>
0014 
0015 #include <QDBusAbstractAdaptor>
0016 #include <QDBusObjectPath>
0017 
0018 namespace BluezQt
0019 {
0020 
0021 class GattDescriptor;
0022 
0023 class GattDescriptorAdaptor : public QDBusAbstractAdaptor
0024 {
0025     Q_OBJECT
0026     Q_CLASSINFO("D-Bus Interface", "org.bluez.GattDescriptor1")
0027     Q_PROPERTY(QString UUID READ uuid)
0028     Q_PROPERTY(QDBusObjectPath Characteristic READ characteristic)
0029     Q_PROPERTY(QByteArray Value READ value)
0030     Q_PROPERTY(QStringList Flags READ flags)
0031 
0032 public:
0033     explicit GattDescriptorAdaptor(GattDescriptor *parent);
0034 
0035     QString uuid() const;
0036     QDBusObjectPath characteristic() const;
0037     QByteArray value() const;
0038     QStringList flags() const;
0039 
0040 public Q_SLOTS:
0041 
0042     QByteArray ReadValue(const QVariantMap &options);
0043     void WriteValue(QByteArray value);
0044 
0045 private:
0046     GattDescriptor *m_gattDescriptor;
0047 };
0048 
0049 }
0050 
0051 #endif