Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qlowenergycharacteristic.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 BlackBerry Limited all rights reserved
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QLOWENERGYCHARACTERISTIC_H
6#define QLOWENERGYCHARACTERISTIC_H
7#include <QtCore/QSharedPointer>
8#include <QtCore/QObject>
9#include <QtBluetooth/qbluetooth.h>
10#include <QtBluetooth/QBluetoothUuid>
11#include <QtBluetooth/QLowEnergyDescriptor>
12
14
15class QBluetoothUuid;
18class Q_BLUETOOTH_EXPORT QLowEnergyCharacteristic
19{
20public:
21
23 Unknown = 0x00,
24 Broadcasting = 0x01,
25 Read = 0x02,
26 WriteNoResponse = 0x04,
27 Write = 0x08,
28 Notify = 0x10,
29 Indicate = 0x20,
30 WriteSigned = 0x40,
31 ExtendedProperty = 0x80
32 };
33 Q_DECLARE_FLAGS(PropertyTypes, PropertyType)
34
38
41 {
42 return equals(a, b);
43 }
45 {
46 return !equals(a, b);
47 }
48
49 QString name() const;
50
51 QBluetoothUuid uuid() const;
52
53 QByteArray value() const;
54
55 QLowEnergyCharacteristic::PropertyTypes properties() const;
56
57 QLowEnergyDescriptor descriptor(const QBluetoothUuid &uuid) const;
58 QList<QLowEnergyDescriptor> descriptors() const;
59
60 QLowEnergyDescriptor clientCharacteristicConfiguration() const;
61
62 bool isValid() const;
63
64 static const QByteArray CCCDDisable;
67
68private:
70 QLowEnergyHandle attributeHandle() const;
71
72 QSharedPointer<QLowEnergyServicePrivate> d_ptr;
73
74 friend class QLowEnergyService;
83 QLowEnergyCharacteristic(QSharedPointer<QLowEnergyServicePrivate> p,
85
86 static bool equals(const QLowEnergyCharacteristic &a, const QLowEnergyCharacteristic &b);
87};
88
89Q_DECLARE_OPERATORS_FOR_FLAGS(QLowEnergyCharacteristic::PropertyTypes)
90
92
94
95#endif // QLOWENERGYCHARACTERISTIC_H
\inmodule QtBluetooth
\inmodule QtCore
Definition qbytearray.h:57
static const QByteArray CCCDEnableIndication
static const QByteArray CCCDDisable
\variable QLowEnergyCharacteristic::CCCDDisable
friend bool operator!=(const QLowEnergyCharacteristic &a, const QLowEnergyCharacteristic &b)
Returns true if a and b are not equal; otherwise false.
PropertyType
This enum describes the properties of a characteristic.
friend bool operator==(const QLowEnergyCharacteristic &a, const QLowEnergyCharacteristic &b)
Returns true if a is equal to b, otherwise false.
static const QByteArray CCCDEnableNotification
\inmodule QtBluetooth
\inmodule QtBluetooth
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Definition lalr.h:268
Combined button and popup list for selecting options.
quint16 QLowEnergyHandle
Definition qbluetooth.h:42
static const QCssKnownValue properties[NumProperties - 1]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
GLboolean GLboolean GLboolean b
GLuint64 GLenum void * handle
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLfloat GLfloat p
[1]
QSharedPointer< T > other(t)
[5]