File indexing completed on 2024-12-08 12:15:33

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2021 Ivan Podkurkov <podkiva2@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef BLUEZQT_GATTDESCRIPTORREMOTE_P_H
0010 #define BLUEZQT_GATTDESCRIPTORREMOTE_P_H
0011 
0012 #include <QObject>
0013 #include <QMap>
0014 
0015 #include "types.h"
0016 #include "bluezgattdescriptor1.h"
0017 #include "dbusproperties.h"
0018 #include "bluezqt_dbustypes.h"
0019 
0020 namespace BluezQt
0021 {
0022 
0023 typedef org::bluez::GattDescriptor1 BluezGattDescriptor;
0024 typedef org::freedesktop::DBus::Properties DBusProperties;
0025 
0026 
0027 class GattDescriptorRemotePrivate : public QObject
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit GattDescriptorRemotePrivate(const QString &path, const QVariantMap &properties, const GattCharacteristicRemotePtr &characteristic);
0033 
0034     void init(const QVariantMap &properties);
0035 
0036     QDBusPendingReply<> setDBusProperty(const QString &name, const QVariant &value);
0037     void propertiesChanged(const QString &path, const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
0038 
0039     QWeakPointer<GattDescriptorRemote> q;
0040     BluezGattDescriptor *m_bluezGattDescriptor;
0041     DBusProperties *m_dbusProperties;
0042 
0043     QString m_uuid;
0044     QByteArray m_value;
0045     QStringList m_flags;
0046     quint16 m_handle;
0047     const GattCharacteristicRemotePtr m_characteristic;
0048 };
0049 
0050 } // namespace BluezQt
0051 
0052 #endif // BLUEZQT_GATTDESCRIPTORREMOTE_P_H