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

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_GATTSERVICE_P_H
0010 #define BLUEZQT_GATTSERVICE_P_H
0011 
0012 #include <QObject>
0013 #include <QStringList>
0014 
0015 #include "types.h"
0016 #include "bluezgattservice1.h"
0017 #include "dbusproperties.h"
0018 #include "bluezqt_dbustypes.h"
0019 
0020 namespace BluezQt
0021 {
0022 
0023 typedef org::bluez::GattService1 BluezGattService;
0024 typedef org::freedesktop::DBus::Properties DBusProperties;
0025 
0026 class GattServiceRemotePrivate : public QObject
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     explicit GattServiceRemotePrivate(const QString &path, const QVariantMap &properties, const DevicePtr &device);
0032 
0033     void init(const QVariantMap &properties);
0034 
0035     void interfacesAdded(const QString &path, const QVariantMapMap &interfaces);
0036     void interfacesRemoved(const QString &path, const QStringList &interfaces);
0037 
0038     void addGattCharacteristic(const QString &gattCharacteristicPath, const QVariantMap &properties);
0039     void removeGattCharacteristic(const QString &gattCharacteristicPath);
0040 
0041     QDBusPendingReply<> setDBusProperty(const QString &name, const QVariant &value);
0042     void propertiesChanged(const QString &path, const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
0043 
0044     QWeakPointer<GattServiceRemote> q;
0045     BluezGattService *m_bluezGattService;
0046     DBusProperties *m_dbusProperties;
0047 
0048     QString m_uuid;
0049     bool m_primary;
0050     const DevicePtr m_device;
0051     QList<QDBusObjectPath> m_includes;
0052     quint16 m_handle;
0053     QList<GattCharacteristicRemotePtr> m_characteristics;
0054 };
0055 
0056 } // namespace BluezQt
0057 
0058 #endif // BLUEZQT_GATTSERVICE_P_H