![]() |
Qt 6.x
The Qt SDK
|
The QLowEnergyCharacteristicData class is used to set up GATT service data. \inmodule QtBluetooth. More...
#include <qlowenergycharacteristicdata.h>
Collaboration diagram for QLowEnergyCharacteristicData:Public Member Functions | |
| QLowEnergyCharacteristicData () | |
| Creates a new invalid object of this class. | |
| QLowEnergyCharacteristicData (const QLowEnergyCharacteristicData &other) | |
| Constructs a new object of this class that is a copy of other. | |
| ~QLowEnergyCharacteristicData () | |
| Destroys this object. | |
| QLowEnergyCharacteristicData & | operator= (const QLowEnergyCharacteristicData &other) |
| Makes this object a copy of other and returns the new value of this object. | |
| QBluetoothUuid | uuid () const |
| Returns the UUID of this characteristic. | |
| void | setUuid (const QBluetoothUuid &uuid) |
| Sets the UUID of this characteristic to uuid. | |
| QByteArray | value () const |
| Returns the value of this characteristic. | |
| void | setValue (const QByteArray &value) |
| Sets the value of this characteristic to value. | |
| QLowEnergyCharacteristic::PropertyTypes | properties () const |
| Returns the properties of this characteristic. | |
| void | setProperties (QLowEnergyCharacteristic::PropertyTypes properties) |
| Sets the properties of this characteristic to properties. | |
| QList< QLowEnergyDescriptorData > | descriptors () const |
| Returns the descriptors of this characteristic. | |
| void | setDescriptors (const QList< QLowEnergyDescriptorData > &descriptors) |
| Sets the descriptors of this characteristic to descriptors. | |
| void | addDescriptor (const QLowEnergyDescriptorData &descriptor) |
| Adds descriptor to the list of descriptors of this characteristic, if it is valid. | |
| void | setReadConstraints (QBluetooth::AttAccessConstraints constraints) |
| Specifies that clients need to fulfill constraints to read the value of this characteristic. | |
| QBluetooth::AttAccessConstraints | readConstraints () const |
| Returns the constraints needed for a client to read the value of this characteristic. | |
| void | setWriteConstraints (QBluetooth::AttAccessConstraints constraints) |
| Specifies that clients need to fulfill constraints to write the value of this characteristic. | |
| QBluetooth::AttAccessConstraints | writeConstraints () const |
| Returns the constraints needed for a client to write the value of this characteristic. | |
| void | setValueLength (int minimum, int maximum) |
| Specifies minimum and maximum to be the smallest and largest length, respectively, that the value of this characteristic can have. | |
| int | minimumValueLength () const |
| Returns the minimum length in bytes that the value of this characteristic can have. | |
| int | maximumValueLength () const |
| Returns the maximum length in bytes that the value of this characteristic can have. | |
| bool | isValid () const |
| Returns true if and only if this characteristic is valid, that is, it has a non-null UUID. | |
| void | swap (QLowEnergyCharacteristicData &other) noexcept |
| Swaps this object with other. | |
Friends | |
| bool | operator== (const QLowEnergyCharacteristicData &a, const QLowEnergyCharacteristicData &b) |
Returns true if a and b are equal with respect to their public state, otherwise returns false. | |
| bool | operator!= (const QLowEnergyCharacteristicData &a, const QLowEnergyCharacteristicData &b) |
Returns true if a and b are not equal with respect to their public state, otherwise returns false. | |
The QLowEnergyCharacteristicData class is used to set up GATT service data. \inmodule QtBluetooth.
An Object of this class provides a characteristic to be added to a \l QLowEnergyServiceData object via \l QLowEnergyServiceData::addCharacteristic().
Definition at line 13 of file qlowenergycharacteristicdata.h.
| QLowEnergyCharacteristicData::QLowEnergyCharacteristicData | ( | ) |
Creates a new invalid object of this class.
Definition at line 51 of file qlowenergycharacteristicdata.cpp.
| QLowEnergyCharacteristicData::QLowEnergyCharacteristicData | ( | const QLowEnergyCharacteristicData & | other | ) |
Constructs a new object of this class that is a copy of other.
Definition at line 57 of file qlowenergycharacteristicdata.cpp.
| QLowEnergyCharacteristicData::~QLowEnergyCharacteristicData | ( | ) |
Destroys this object.
Definition at line 63 of file qlowenergycharacteristicdata.cpp.
| void QLowEnergyCharacteristicData::addDescriptor | ( | const QLowEnergyDescriptorData & | descriptor | ) |
Adds descriptor to the list of descriptors of this characteristic, if it is valid.
Definition at line 135 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::descriptors, QLowEnergyDescriptorData::isValid(), and qCWarning.
Referenced by setDescriptors().
Here is the call graph for this function:
Here is the caller graph for this function:| QList< QLowEnergyDescriptorData > QLowEnergyCharacteristicData::descriptors | ( | ) | const |
Returns the descriptors of this characteristic.
Definition at line 114 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::descriptors.
Referenced by setDescriptors().
Here is the caller graph for this function:| bool QLowEnergyCharacteristicData::isValid | ( | ) | const |
Returns true if and only if this characteristic is valid, that is, it has a non-null UUID.
Definition at line 213 of file qlowenergycharacteristicdata.cpp.
References QUuid::isNull(), and uuid().
Referenced by QLowEnergyServiceData::addCharacteristic().
Here is the call graph for this function:
Here is the caller graph for this function:| int QLowEnergyCharacteristicData::maximumValueLength | ( | ) | const |
Returns the maximum length in bytes that the value of this characteristic can have.
By default, there is no limit beyond the constraints of the data type.
Definition at line 205 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::maximumValueLength.
| int QLowEnergyCharacteristicData::minimumValueLength | ( | ) | const |
Returns the minimum length in bytes that the value of this characteristic can have.
The default is zero.
Definition at line 196 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::minimumValueLength.
| QLowEnergyCharacteristicData & QLowEnergyCharacteristicData::operator= | ( | const QLowEnergyCharacteristicData & | other | ) |
Makes this object a copy of other and returns the new value of this object.
Definition at line 68 of file qlowenergycharacteristicdata.cpp.
References other().
Here is the call graph for this function:| QLowEnergyCharacteristic::PropertyTypes QLowEnergyCharacteristicData::properties | ( | ) | const |
Returns the properties of this characteristic.
Definition at line 99 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::properties.
Referenced by setProperties(), and setupCharPermissions().
Here is the caller graph for this function:| QBluetooth::AttAccessConstraints QLowEnergyCharacteristicData::readConstraints | ( | ) | const |
Returns the constraints needed for a client to read the value of this characteristic.
If \l properties() does not include \l QLowEnergyCharacteristic::Read, this value is irrelevant. By default, there are no read constraints.
Definition at line 156 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::readConstraints.
Referenced by setupCharPermissions().
Here is the caller graph for this function:| void QLowEnergyCharacteristicData::setDescriptors | ( | const QList< QLowEnergyDescriptorData > & | descriptors | ) |
Sets the descriptors of this characteristic to descriptors.
Only valid descriptors are considered.
Definition at line 124 of file qlowenergycharacteristicdata.cpp.
References addDescriptor(), QList< T >::clear(), desc, QLowEnergyCharacteristicDataPrivate::descriptors, and descriptors().
Here is the call graph for this function:| void QLowEnergyCharacteristicData::setProperties | ( | QLowEnergyCharacteristic::PropertyTypes | properties | ) |
Sets the properties of this characteristic to properties.
Definition at line 105 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristic::Indicate, QLowEnergyCharacteristic::Notify, QLowEnergyCharacteristicDataPrivate::properties, properties(), qCWarning, and QLowEnergyCharacteristicDataPrivate::uuid.
Here is the call graph for this function:| void QLowEnergyCharacteristicData::setReadConstraints | ( | QBluetooth::AttAccessConstraints | constraints | ) |
Specifies that clients need to fulfill constraints to read the value of this characteristic.
Definition at line 146 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::readConstraints.
| void QLowEnergyCharacteristicData::setUuid | ( | const QBluetoothUuid & | uuid | ) |
Sets the UUID of this characteristic to uuid.
Definition at line 81 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::uuid, and uuid().
Here is the call graph for this function:| void QLowEnergyCharacteristicData::setValue | ( | const QByteArray & | value | ) |
Sets the value of this characteristic to value.
Definition at line 93 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::value, and value().
Here is the call graph for this function:| void QLowEnergyCharacteristicData::setValueLength | ( | int | minimum, |
| int | maximum | ||
| ) |
Specifies minimum and maximum to be the smallest and largest length, respectively, that the value of this characteristic can have.
The unit is bytes. If minimum and maximum are equal, the characteristic has a fixed-length value.
Definition at line 186 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::maximumValueLength, QLowEnergyCharacteristicDataPrivate::minimumValueLength, and qMax().
Here is the call graph for this function:| void QLowEnergyCharacteristicData::setWriteConstraints | ( | QBluetooth::AttAccessConstraints | constraints | ) |
Specifies that clients need to fulfill constraints to write the value of this characteristic.
Definition at line 164 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::writeConstraints.
|
inlinenoexcept |
Swaps this object with other.
Definition at line 57 of file qlowenergycharacteristicdata.h.
Here is the call graph for this function:| QBluetoothUuid QLowEnergyCharacteristicData::uuid | ( | ) | const |
Returns the UUID of this characteristic.
Definition at line 75 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::uuid.
Referenced by isValid(), and setUuid().
Here is the caller graph for this function:| QByteArray QLowEnergyCharacteristicData::value | ( | ) | const |
Returns the value of this characteristic.
Definition at line 87 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::value.
Referenced by QtBluezPeripheralCharacteristic::QtBluezPeripheralCharacteristic(), and setValue().
Here is the caller graph for this function:| QBluetooth::AttAccessConstraints QLowEnergyCharacteristicData::writeConstraints | ( | ) | const |
Returns the constraints needed for a client to write the value of this characteristic.
If \l properties() does not include either of \l QLowEnergyCharacteristic::Write, \l QLowEnergyCharacteristic::WriteNoResponse and \l QLowEnergyCharacteristic::WriteSigned, this value is irrelevant. By default, there are no write constraints.
Definition at line 176 of file qlowenergycharacteristicdata.cpp.
References QLowEnergyCharacteristicDataPrivate::writeConstraints.
Referenced by setupCharPermissions().
Here is the caller graph for this function:
|
friend |
Returns true if a and b are not equal with respect to their public state, otherwise returns false.
Definition at line 26 of file qlowenergycharacteristicdata.h.
|
friend |
Returns true if a and b are equal with respect to their public state, otherwise returns false.
Definition at line 21 of file qlowenergycharacteristicdata.h.