![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtBluetooth More...
#include <qlowenergydescriptor.h>
Public Member Functions | |
QLowEnergyDescriptor () | |
Construct a new QLowEnergyDescriptor. | |
QLowEnergyDescriptor (const QLowEnergyDescriptor &other) | |
Construct a new QLowEnergyDescriptor that is a copy of other. | |
~QLowEnergyDescriptor () | |
Destroys the QLowEnergyDescriptor object. | |
QLowEnergyDescriptor & | operator= (const QLowEnergyDescriptor &other) |
Makes a copy of other and assigns it to this QLowEnergyDescriptor object. | |
bool | isValid () const |
Returns true if the QLowEnergyDescriptor object is valid, otherwise returns false . | |
QByteArray | value () const |
Returns the cached value of the descriptor. | |
QBluetoothUuid | uuid () const |
Returns the UUID of this descriptor if \l isValid() returns true ; otherwise a \l {QUuid::isNull()}{null} UUID. | |
QString | name () const |
Returns the human-readable name of the descriptor. | |
QBluetoothUuid::DescriptorType | type () const |
Returns the type of the descriptor. | |
Friends | |
class | QLowEnergyCharacteristic |
class | QLowEnergyService |
class | QLowEnergyControllerPrivate |
class | QLowEnergyControllerPrivateAndroid |
class | QLowEnergyControllerPrivateBluez |
class | QLowEnergyControllerPrivateBluezDBus |
class | QLowEnergyControllerPrivateCommon |
class | QLowEnergyControllerPrivateDarwin |
class | QLowEnergyControllerPrivateWinRT |
bool | operator== (const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b) |
Returns true if a is equal to b; otherwise false . | |
bool | operator!= (const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b) |
Returns true if a is not equal to b; otherwise false . | |
\inmodule QtBluetooth
The QLowEnergyDescriptor class stores information about the Bluetooth Low Energy descriptor.
QLowEnergyDescriptor provides information about a Bluetooth Low Energy descriptor's name(), uuid(), and value(). Descriptors are encapsulated by Bluetooth Low Energy characteristics and provide additional contextual information about the characteristic (data format, notification activation and so on).
The descriptor value may be written via the QLowEnergyService instance that manages the service to which this descriptor belongs. The \l {QLowEnergyService::writeDescriptor()} function writes the new value. The \l {QLowEnergyService::descriptorWritten()} signal is emitted upon success. The cached value() of this object is updated accordingly.
Definition at line 18 of file qlowenergydescriptor.h.
QLowEnergyDescriptor::QLowEnergyDescriptor | ( | ) |
Construct a new QLowEnergyDescriptor.
A default-constructed instance of this class is always invalid.
Definition at line 45 of file qlowenergydescriptor.cpp.
QLowEnergyDescriptor::QLowEnergyDescriptor | ( | const QLowEnergyDescriptor & | other | ) |
Construct a new QLowEnergyDescriptor that is a copy of other.
The two copies continue to share the same underlying data which does not detach upon write.
Definition at line 56 of file qlowenergydescriptor.cpp.
References other().
QLowEnergyDescriptor::~QLowEnergyDescriptor | ( | ) |
Destroys the QLowEnergyDescriptor object.
Definition at line 84 of file qlowenergydescriptor.cpp.
bool QLowEnergyDescriptor::isValid | ( | ) | const |
Returns true
if the QLowEnergyDescriptor object is valid, otherwise returns false
.
An invalid descriptor instance is not associated with any service (default-constructed) or the associated service is no longer valid due to a disconnect from the underlying Bluetooth Low Energy device, for example. Once the object is invalid it cannot become valid anymore.
Definition at line 173 of file qlowenergydescriptor.cpp.
References QLowEnergyService::InvalidService, QSharedPointer< T >::isNull(), and QLowEnergyServicePrivate::state.
Referenced by MyClass::enableCharNotifications(), QLowEnergyControllerPrivateBluezDBus::readDescriptor(), and QLowEnergyControllerPrivateBluezDBus::writeDescriptor().
QString QLowEnergyDescriptor::name | ( | ) | const |
Returns the human-readable name of the descriptor.
The name is based on the descriptor's \l type(). The complete list of descriptor types can be found under \l {https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx}{Bluetooth.org Descriptors}.
The returned string is empty if the \l type() is unknown.
Definition at line 247 of file qlowenergydescriptor.cpp.
References QBluetoothUuid::descriptorToString(), and type().
QLowEnergyDescriptor & QLowEnergyDescriptor::operator= | ( | const QLowEnergyDescriptor & | other | ) |
Makes a copy of other and assigns it to this QLowEnergyDescriptor object.
The two copies continue to share the same service and controller details.
Definition at line 93 of file qlowenergydescriptor.cpp.
References other().
QBluetoothUuid::DescriptorType QLowEnergyDescriptor::type | ( | ) | const |
Returns the type of the descriptor.
Definition at line 257 of file qlowenergydescriptor.cpp.
References QBluetoothUuid::CharacteristicAggregateFormat, QBluetoothUuid::CharacteristicExtendedProperties, QBluetoothUuid::CharacteristicPresentationFormat, QBluetoothUuid::CharacteristicUserDescription, QBluetoothUuid::ClientCharacteristicConfiguration, QBluetoothUuid::ExternalReportReference, ok, QBluetoothUuid::ReportReference, QBluetoothUuid::ServerCharacteristicConfiguration, QBluetoothUuid::toUInt16(), QBluetoothUuid::UnknownDescriptorType, uuid(), and QBluetoothUuid::ValidRange.
Referenced by name().
QBluetoothUuid QLowEnergyDescriptor::uuid | ( | ) | const |
Returns the UUID of this descriptor if \l isValid() returns true
; otherwise a \l {QUuid::isNull()}{null} UUID.
Definition at line 188 of file qlowenergydescriptor.cpp.
References QLowEnergyServicePrivate::characteristicList, and QSharedPointer< T >::isNull().
Referenced by type(), QLowEnergyService::writeDescriptor(), and QLowEnergyControllerPrivateBluezDBus::writeDescriptor().
QByteArray QLowEnergyDescriptor::value | ( | ) | const |
Returns the cached value of the descriptor.
The cached descriptor value may be updated using \l QLowEnergyService::writeDescriptor() or \l QLowEnergyService::readDescriptor().
Definition at line 223 of file qlowenergydescriptor.cpp.
References QLowEnergyServicePrivate::characteristicList, and QSharedPointer< T >::isNull().
Referenced by QLowEnergyControllerPrivateBluezDBus::readDescriptor().
|
friend |
Returns true
if a is not equal to b; otherwise false
.
Two QLowEnergyDescriptor instances are considered to be equal if they refer to the same descriptor on the same remote Bluetooth Low Energy device or both instances have been default-constructed.
Definition at line 30 of file qlowenergydescriptor.h.
|
friend |
Returns true
if a is equal to b; otherwise false
.
Two QLowEnergyDescriptor instances are considered to be equal if they refer to the same descriptor on the same remote Bluetooth Low Energy device or both instances have been default-constructed.
Definition at line 26 of file qlowenergydescriptor.h.
|
friend |
Definition at line 49 of file qlowenergydescriptor.h.
|
friend |
Definition at line 51 of file qlowenergydescriptor.h.
|
friend |
Definition at line 52 of file qlowenergydescriptor.h.
|
friend |
Definition at line 53 of file qlowenergydescriptor.h.
|
friend |
Definition at line 54 of file qlowenergydescriptor.h.
|
friend |
Definition at line 55 of file qlowenergydescriptor.h.
|
friend |
Definition at line 56 of file qlowenergydescriptor.h.
|
friend |
Definition at line 57 of file qlowenergydescriptor.h.
|
friend |
Definition at line 50 of file qlowenergydescriptor.h.