Sur cette page

QLowEnergyDescriptorData Class

La classe `QLowEnergyDescriptorData` sert à créer des données de service GATT. En savoir plus...

En-tête : #include <QLowEnergyDescriptorData>
CMake : find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
qmake : QT += bluetooth

Fonctions publiques

QLowEnergyDescriptorData()
QLowEnergyDescriptorData(const QBluetoothUuid &uuid, const QByteArray &value)
QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other)
~QLowEnergyDescriptorData()
bool isReadable() const
bool isValid() const
bool isWritable() const
QBluetooth::AttAccessConstraints readConstraints() const
void setReadPermissions(bool readable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints())
void setUuid(const QBluetoothUuid &uuid)
void setValue(const QByteArray &value)
void setWritePermissions(bool writable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints())
void swap(QLowEnergyDescriptorData &other)
QBluetoothUuid uuid() const
QByteArray value() const
QBluetooth::AttAccessConstraints writeConstraints() const
QLowEnergyDescriptorData &operator=(const QLowEnergyDescriptorData &other)
bool operator!=(const QLowEnergyDescriptorData &a, const QLowEnergyDescriptorData &b)
bool operator==(const QLowEnergyDescriptorData &a, const QLowEnergyDescriptorData &b)

Description détaillée

Un objet de cette classe fournit un descripteur à ajouter à un objet « QLowEnergyCharacteristicData » via la méthode ` QLowEnergyCharacteristicData::addDescriptor()`.

Remarque : les fonctions membres liées aux autorisations d’accès ne s’appliquent qu’aux types de descripteurs pour lesquels la spécification Bluetooth ne précise pas si et comment leurs valeurs sont accessibles.

Voir également QLowEnergyCharacteristicData, QLowEnergyServiceData et QLowEnergyController::addService.

Documentation des fonctions membres

QLowEnergyDescriptorData::QLowEnergyDescriptorData()

Crée un nouvel objet non valide de cette classe.

QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QBluetoothUuid &uuid, const QByteArray &value)

Crée un nouvel objet de cette classe dont l'UUID et la valeur sont fournis respectivement par uuid et value.

QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other)

Crée un nouvel objet de cette classe qui est une copie de other.

[noexcept] QLowEnergyDescriptorData::~QLowEnergyDescriptorData()

Détruit cet objet.

bool QLowEnergyDescriptorData::isReadable() const

Renvoie ` true ` si la valeur de ce descripteur est lisible, et ` false ` dans le cas contraire.

bool QLowEnergyDescriptorData::isValid() const

Renvoie « true » si et seulement si cet objet possède un UUID non nul.

bool QLowEnergyDescriptorData::isWritable() const

Renvoie « true » si la valeur de ce descripteur est accessible en écriture, et « false » dans le cas contraire.

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::readConstraints() const

Renvoie les contraintes régissant la lecture de la valeur de ce descripteur. Cette valeur n'est pertinente que si la fonction ` isReadable()` renvoie la valeur ` true`.

void QLowEnergyDescriptorData::setReadPermissions(bool readable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints())

Indique si la valeur de ce descripteur est « readable » et, le cas échéant, sous quelle constraints.

Voir également setWritePermissions().

void QLowEnergyDescriptorData::setUuid(const QBluetoothUuid &uuid)

Définit l'UUID de ce descripteur sur uuid.

Voir également uuid().

void QLowEnergyDescriptorData::setValue(const QByteArray &value)

Définit la valeur de ce descripteur sur value. Cette valeur sera transmise à un périphérique homologue exactement telle qu'elle est fournie ici ; les appelants doivent donc prêter attention à certains aspects, tels que l'endianité.

Voir également value().

void QLowEnergyDescriptorData::setWritePermissions(bool writable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints())

Indique si la valeur de ce descripteur est « writable » et, le cas échéant, sous quelle constraints.

Voir également setReadPermissions().

[noexcept] void QLowEnergyDescriptorData::swap(QLowEnergyDescriptorData &other)

Permute cet objet avec celui de l'other.

QBluetoothUuid QLowEnergyDescriptorData::uuid() const

Renvoie l'UUID de ce descripteur.

Voir aussi setUuid().

QByteArray QLowEnergyDescriptorData::value() const

Renvoie la valeur de ce descripteur.

Voir aussi setValue().

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::writeConstraints() const

Renvoie les contraintes régissant l'écriture de la valeur de ce descripteur. Cette valeur n'est pertinente que si la fonction ` isWritable()` renvoie ` true`.

QLowEnergyDescriptorData &QLowEnergyDescriptorData::operator=(const QLowEnergyDescriptorData &other)

Fait de cet objet une copie de other et renvoie la nouvelle valeur de cet objet.

Éléments non membres associés

bool operator!=(const QLowEnergyDescriptorData &a, const QLowEnergyDescriptorData &b)

Renvoie « true » si « a » et « b » ne sont pas égaux au niveau de leur état public ; sinon, renvoie « false ».

bool operator==(const QLowEnergyDescriptorData &a, const QLowEnergyDescriptorData &b)

Renvoie ` true ` si ` a ` et ` b ` sont égales au niveau de leur état public ; sinon, renvoie ` false`.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.