Sur cette page

QLowEnergyDescriptorData Class

La classe QLowEnergyDescriptorData est utilisée pour créer des données de service GATT. Plus d'informations...

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 QLowEnergyCharacteristicData::addDescriptor().

Remarque : les fonctions membres relatives aux autorisations d'accès ne s'appliquent qu'aux types de descripteurs pour lesquels la spécification Bluetooth ne prescrit pas si et comment leurs valeurs peuvent être consultées.

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

Documentation des fonctions membres

QLowEnergyDescriptorData::QLowEnergyDescriptorData()

Crée un nouvel objet invalide 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 par uuid et value, respectivement.

QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other)

Construit 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

Retourne vrai si et seulement si cet objet a 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 sous lesquelles la valeur de ce descripteur peut être lue. Cette valeur n'est pertinente que si isReadable() renvoie true.

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

Précise 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 à uuid.

Voir aussi uuid().

void QLowEnergyDescriptorData::setValue(const QByteArray &value)

Définit la valeur de ce descripteur à value. Il sera envoyé à un périphérique homologue exactement comme il est fourni ici, de sorte que les appelants doivent s'occuper de choses telles que l'endianness.

Voir aussi value().

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

Précise 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)

Remplace cet objet par 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 sous lesquelles la valeur de ce descripteur peut être écrite. Cette valeur n'est pertinente que si 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.

Non-membres apparentés

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

Renvoie true si a et b sont inégaux en ce qui concerne leur état public, sinon renvoie false.

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

Renvoie true si a et b sont égaux en ce qui concerne 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.