BluezQt 5.109.0
gattdescriptorremote.h
1/*
2 * BluezQt - Asynchronous Bluez wrapper library
3 *
4 * SPDX-FileCopyrightText: 2021 Ivan Podkurkov <podkiva2@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#ifndef BLUEZQT_GATTDESCRIPTORREMOTE_H
10#define BLUEZQT_GATTDESCRIPTORREMOTE_H
11
12#include <QObject>
13#include <QMap>
14
15#include "types.h"
16#include "bluezqt_export.h"
17
18namespace BluezQt
19{
20
21class GattCharacteristicRemote;
22class PendingCall;
23
31class BLUEZQT_EXPORT GattDescriptorRemote : public QObject
32{
33 Q_OBJECT
34 Q_PROPERTY(QString ubi READ ubi CONSTANT)
35 Q_PROPERTY(QString uuid READ uuid NOTIFY uuidChanged)
36 Q_PROPERTY(QByteArray value READ value NOTIFY valueChanged)
37 Q_PROPERTY(QStringList flags READ flags NOTIFY flagsChanged)
38 Q_PROPERTY(quint16 handle READ handle NOTIFY handleChanged)
39 Q_PROPERTY(GattCharacteristicRemotePtr characteristic READ characteristic CONSTANT)
40
41
42public:
47
53 GattDescriptorRemotePtr toSharedPtr() const;
54
62 QString ubi() const;
63
69 QString uuid() const;
70
76 QByteArray value() const;
77
83 QStringList flags() const;
84
90 quint16 handle() const;
91
98 PendingCall *setHandle(quint16 handle);
99
105 GattCharacteristicRemotePtr characteristic() const;
106
107public Q_SLOTS:
119 PendingCall *readValue(const QVariantMap &options);
120
131 PendingCall *writeValue(const QByteArray &value, const QVariantMap &options);
132
133Q_SIGNALS:
137 void descriptorChanged(GattDescriptorRemotePtr descriptor);
138
142 void uuidChanged(const QString &uuid);
143
147 void valueChanged(const QByteArray value);
148
152 void flagsChanged(QStringList flags);
153
157 void handleChanged(quint16 handle);
158
159private:
160 BLUEZQT_NO_EXPORT explicit GattDescriptorRemote(const QString &path, const QVariantMap &properties, GattCharacteristicRemotePtr characteristic);
161
162 const std::unique_ptr<class GattDescriptorRemotePrivate> d;
163
164 friend class DevicePrivate;
165 friend class GattServiceRemotePrivate;
166 friend class GattCharacteristicRemotePrivate;
167 friend class GattDescriptorRemotePrivate;
168 friend class ManagerPrivate;
169 friend class Adapter;
170};
171
172} // namespace BluezQt
173
174#endif // BLUEZQT_GATTDESCRIPTORREMOTE_H
Bluetooth adapter.
Definition adapter.h:33
Bluetooth LE GATT descriptor.
Definition gattdescriptorremote.h:32
void descriptorChanged(GattDescriptorRemotePtr descriptor)
Indicates that at least one of the descriptors's properties have changed.
PendingCall * readValue(const QVariantMap &options)
Read the value of the GATT descriptor.
GattDescriptorRemotePtr toSharedPtr() const
Returns a shared pointer from this.
void uuidChanged(const QString &uuid)
Indicates that descriptor's uuid have changed.
QString ubi() const
Returns an UBI of the GATT descriptor.
GattCharacteristicRemotePtr characteristic() const
Returns a characteristic that owns that descriptor.
void flagsChanged(QStringList flags)
Indicates that descriptor's flags have changed.
~GattDescriptorRemote() override
Destroys a GattDescriptor object.
PendingCall * setHandle(quint16 handle)
Sets the descriptor handle.
quint16 handle() const
Returns descriptor handle.
void valueChanged(const QByteArray value)
Indicates that descriptor's value have changed.
QString uuid() const
Returns an uuid of the descriptor.
PendingCall * writeValue(const QByteArray &value, const QVariantMap &options)
Write the value of the GATT descriptor.
void handleChanged(quint16 handle)
Indicates that descriptor's handle have changed.
QByteArray value() const
Returns an value of the descriptor.
QStringList flags() const
Returns flags the descriptor.
Pending method call.
Definition pendingcall.h:33