![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QLowEnergyCharacteristicData class is used to set up GATT service data. \inmodule QtBluetooth. More...
#include <qlowenergycharacteristicdata.h>
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.
QList< QLowEnergyDescriptorData > QLowEnergyCharacteristicData::descriptors | ( | ) | const |
Returns the descriptors of this characteristic.
Definition at line 114 of file qlowenergycharacteristicdata.cpp.
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.
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.
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.
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.
QLowEnergyCharacteristic::PropertyTypes QLowEnergyCharacteristicData::properties | ( | ) | const |
Returns the properties of this characteristic.
Definition at line 99 of file qlowenergycharacteristicdata.cpp.
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.
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.
void QLowEnergyCharacteristicData::setProperties | ( | QLowEnergyCharacteristic::PropertyTypes | properties | ) |
Sets the properties of this characteristic to properties.
Definition at line 105 of file qlowenergycharacteristicdata.cpp.
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.
void QLowEnergyCharacteristicData::setUuid | ( | const QBluetoothUuid & | uuid | ) |
Sets the UUID of this characteristic to uuid.
Definition at line 81 of file qlowenergycharacteristicdata.cpp.
void QLowEnergyCharacteristicData::setValue | ( | const QByteArray & | value | ) |
Sets the value of this characteristic to value.
Definition at line 93 of file qlowenergycharacteristicdata.cpp.
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.
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.
|
inlinenoexcept |
Swaps this object with other.
Definition at line 57 of file qlowenergycharacteristicdata.h.
QBluetoothUuid QLowEnergyCharacteristicData::uuid | ( | ) | const |
Returns the UUID of this characteristic.
Definition at line 75 of file qlowenergycharacteristicdata.cpp.
QByteArray QLowEnergyCharacteristicData::value | ( | ) | const |
Returns the value of this characteristic.
Definition at line 87 of file qlowenergycharacteristicdata.cpp.
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.
|
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.