Nesta página

QLowEnergyDescriptorData Class

A classe QLowEnergyDescriptorData é usada para criar dados de serviço GATT. Saiba mais...

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

Funções 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)

Descrição detalhada

Um objeto dessa classe fornece um descritor a ser adicionado a um objeto ` QLowEnergyCharacteristicData ` por meio de ` QLowEnergyCharacteristicData::addDescriptor()`.

Observação: As funções-membro relacionadas às permissões de acesso são aplicáveis apenas aos tipos de descritores para os quais a especificação Bluetooth não determina se e como seus valores podem ser acessados.

Veja também QLowEnergyCharacteristicData, QLowEnergyServiceData e QLowEnergyController::addService.

Documentação das funções-membro

QLowEnergyDescriptorData::QLowEnergyDescriptorData()

Cria um novo objeto inválido desta classe.

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

Cria um novo objeto desta classe com UUID e valor fornecidos por uuid e value, respectivamente.

QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other)

Cria um novo objeto desta classe que é uma cópia de ` other`.

[noexcept] QLowEnergyDescriptorData::~QLowEnergyDescriptorData()

Destrói este objeto.

bool QLowEnergyDescriptorData::isReadable() const

Retorna ` true ` se o valor deste descritor for legível e ` false ` caso contrário.

bool QLowEnergyDescriptorData::isValid() const

Retorna `true` se, e somente se, este objeto tiver um UUID diferente de `null`.

bool QLowEnergyDescriptorData::isWritable() const

Retorna ` true ` se o valor deste descritor for gravável e ` false ` caso contrário.

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::readConstraints() const

Retorna as restrições sob as quais o valor deste descritor pode ser lido. Esse valor só é relevante se ` isReadable()` retornar ` true`.

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

Especifica se o valor deste descritor é “ readable ” e, em caso afirmativo, sob qual “ constraints ”.

Veja também setWritePermissions().

void QLowEnergyDescriptorData::setUuid(const QBluetoothUuid &uuid)

Define o UUID deste descritor como uuid.

Veja também uuid().

void QLowEnergyDescriptorData::setValue(const QByteArray &value)

Define o valor deste descritor como value. Ele será enviado a um dispositivo par exatamente da forma como é fornecido aqui; portanto, os chamadores precisam levar em consideração aspectos como a endianidade.

Veja também value().

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

Especifica se o valor deste descritor é “ writable ” e, em caso afirmativo, sob qual constraints.

Veja também setReadPermissions().

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

Troca este objeto por other.

QBluetoothUuid QLowEnergyDescriptorData::uuid() const

Retorna o UUID deste descritor.

Veja também setUuid().

QByteArray QLowEnergyDescriptorData::value() const

Retorna o valor deste descritor.

Veja também setValue().

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::writeConstraints() const

Retorna as restrições sob as quais o valor deste descritor pode ser gravado. Esse valor só é relevante se ` isWritable()` retornar ` true`.

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

Transforma este objeto em uma cópia de ` other ` e retorna o novo valor deste objeto.

Não-membros relacionados

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

Retorna ` true ` se ` a ` e ` b ` forem diferentes em relação ao seu estado público; caso contrário, retorna ` false`.

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

Retorna ` true ` se ` a ` e ` b ` forem iguais em relação ao seu estado público; caso contrário, retorna ` 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.