En esta página

QLowEnergyDescriptorData Class

La clase QLowEnergyDescriptorData se utiliza para crear datos de servicio GATT. Más...

Cabecera: #include <QLowEnergyDescriptorData>
CMake: find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
qmake: QT += bluetooth

Funciones Públicas

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)

Descripción detallada

Un objeto de esta clase proporciona un descriptor que se añade a un objeto QLowEnergyCharacteristicData a través de QLowEnergyCharacteristicData::addDescriptor().

Nota: Las funciones miembro relacionadas con los permisos de acceso sólo son aplicables a aquellos tipos de descriptores para los que la especificación Bluetooth no prescribe si se puede acceder a sus valores y cómo.

Véase también QLowEnergyCharacteristicData, QLowEnergyServiceData, y QLowEnergyController::addService.

Documentación de las funciones miembro

QLowEnergyDescriptorData::QLowEnergyDescriptorData()

Crea un nuevo objeto inválido de esta clase.

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

Crea un nuevo objeto de esta clase con UUID y valor proporcionados por uuid y value, respectivamente.

QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other)

Construye un nuevo objeto de esta clase que es una copia de other.

[noexcept] QLowEnergyDescriptorData::~QLowEnergyDescriptorData()

Destruye este objeto.

bool QLowEnergyDescriptorData::isReadable() const

Devuelve true si el valor de este descriptor es legible y false en caso contrario.

bool QLowEnergyDescriptorData::isValid() const

Devuelve true si y sólo si este objeto tiene un UUID no nulo.

bool QLowEnergyDescriptorData::isWritable() const

Devuelve true si el valor de este descriptor es escribible y false en caso contrario.

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::readConstraints() const

Devuelve las restricciones bajo las cuales se puede leer el valor de este descriptor. Este valor sólo es relevante si isReadable() devuelve true.

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

Especifica si el valor de este descriptor es readable y, en caso afirmativo, bajo qué constraints.

Véase también setWritePermissions().

void QLowEnergyDescriptorData::setUuid(const QBluetoothUuid &uuid)

Establece el UUID de este descriptor en uuid.

Véase también uuid().

void QLowEnergyDescriptorData::setValue(const QByteArray &value)

Establece el valor de este descriptor a value. Se enviará a un dispositivo par exactamente de la forma en que se proporciona aquí, por lo que los llamantes deben tener cuidado de cosas tales como endianness.

Véase también value().

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

Especifica si el valor de este descriptor es writable y, en caso afirmativo, bajo qué constraints.

Véase también setReadPermissions().

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

Intercambia este objeto con other.

QBluetoothUuid QLowEnergyDescriptorData::uuid() const

Devuelve el UUID de este descriptor.

Véase también setUuid().

QByteArray QLowEnergyDescriptorData::value() const

Devuelve el valor de este descriptor.

Véase también setValue().

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::writeConstraints() const

Devuelve las restricciones bajo las cuales se puede escribir el valor de este descriptor. Este valor sólo es relevante si isWritable() devuelve true.

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

Hace de este objeto una copia de other y devuelve el nuevo valor de este objeto.

No miembros relacionados

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

Devuelve true si a y b son desiguales con respecto a su estado público, en caso contrario devuelve false.

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

Devuelve true si a y b son iguales con respecto a su estado público, en caso contrario devuelve 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.