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
qlowenergydescriptordata.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QtCore/qbytearray.h>
7
9
11{
13
16 QBluetooth::AttAccessConstraints readConstraints;
17 QBluetooth::AttAccessConstraints writeConstraints;
20};
21
45
57
63
68
75
78{
79 return d->value;
80}
81
90
96
99{
100 d->uuid = uuid;
101}
102
105{
106 return !uuid().isNull();
107}
108
115 QBluetooth::AttAccessConstraints constraints)
116{
117 d->readable = readable;
118 d->readConstraints = constraints;
119}
120
123{
124 return d->readable;
125}
126
131QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::readConstraints() const
132{
133 return d->readConstraints;
134}
135
142 QBluetooth::AttAccessConstraints constraints)
143{
144 d->writable = writable;
145 d->writeConstraints = constraints;
146}
147
150{
151 return d->writable;
152}
153
158QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::writeConstraints() const
159{
160 return d->writeConstraints;
161}
162
189bool QLowEnergyDescriptorData::equals(const QLowEnergyDescriptorData &a,
191{
192 return a.d == b.d || (
193 a.uuid() == b.uuid()
194 && a.value() == b.value()
195 && a.isReadable() == b.isReadable()
196 && a.isWritable() == b.isWritable()
197 && a.readConstraints() == b.readConstraints()
198 && a.writeConstraints() == b.writeConstraints());
199}
200
\inmodule QtBluetooth
\inmodule QtCore
Definition qbytearray.h:57
The QLowEnergyDescriptorData class is used to create GATT service data. \inmodule QtBluetooth.
bool isValid() const
Returns true if and only if this object has a non-null UUID.
QLowEnergyDescriptorData()
Creates a new invalid object of this class.
bool isReadable() const
Returns true if the value of this descriptor is readable and false otherwise.
void setUuid(const QBluetoothUuid &uuid)
Sets the UUID of this descriptor to uuid.
void setWritePermissions(bool writable, QBluetooth::AttAccessConstraints constraints=QBluetooth::AttAccessConstraints())
Specifies whether the value of this descriptor is writable and if so, under which constraints.
QBluetooth::AttAccessConstraints readConstraints() const
Returns the constraints under which the value of this descriptor can be read.
bool isWritable() const
Returns true if the value of this descriptor is writable and false otherwise.
QByteArray value() const
Returns the value of this descriptor.
QBluetooth::AttAccessConstraints writeConstraints() const
Returns the constraints under which the value of this descriptor can be written.
void setValue(const QByteArray &value)
Sets the value of this descriptor to value.
QLowEnergyDescriptorData & operator=(const QLowEnergyDescriptorData &other)
Makes this object a copy of other and returns the new value of this object.
QBluetoothUuid uuid() const
Returns the UUID of this descriptor.
void setReadPermissions(bool readable, QBluetooth::AttAccessConstraints constraints=QBluetooth::AttAccessConstraints())
Specifies whether the value of this descriptor is readable and if so, under which constraints.
~QLowEnergyDescriptorData()
Destroys this object.
\inmodule QtCore
Definition qshareddata.h:19
bool isNull() const noexcept
Returns true if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns false...
Definition quuid.cpp:818
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
QSharedPointer< T > other(t)
[5]
QBluetooth::AttAccessConstraints writeConstraints
QBluetooth::AttAccessConstraints readConstraints