QLowEnergyDescriptorData Class
The QLowEnergyDescriptorData class is used to create GATT service data. 更多...
头文件: | #include <QLowEnergyDescriptorData> |
qmake: | QT += bluetooth |
开始支持版本: | Qt 5.7 |
公有函数
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) |
详细描述
The QLowEnergyDescriptorData class is used to create GATT service data.
An object of this class provides a descriptor to be added to a QLowEnergyCharacteristicData object via QLowEnergyCharacteristicData::addDescriptor().
Note: The member functions related to access permissions are only applicable to those types of descriptors for which the Bluetooth specification does not prescribe if and how their values can be accessed.
参见 QLowEnergyCharacteristicData, QLowEnergyServiceData, and QLowEnergyController::addService.
成员函数
QLowEnergyDescriptorData::QLowEnergyDescriptorData()
Creates a new invalid object of this class.
QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QBluetoothUuid &uuid, const QByteArray &value)
Creates a new object of this class with UUID and value being provided by uuid and value, respectively.
QLowEnergyDescriptorData::QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other)
Constructs a new object of this class that is a copy of other.
QLowEnergyDescriptorData::~QLowEnergyDescriptorData()
Destroys this object.
bool QLowEnergyDescriptorData::isReadable() const
Returns true
if the value of this descriptor is readable and false
otherwise.
bool QLowEnergyDescriptorData::isValid() const
Returns true if and only if this object has a non-null UUID.
bool QLowEnergyDescriptorData::isWritable() const
Returns true
if the value of this descriptor is writable and false
otherwise.
QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::readConstraints() const
Returns the constraints under which the value of this descriptor can be read. This value is only relevant if isReadable() returns true
.
void QLowEnergyDescriptorData::setReadPermissions(bool readable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints())
Specifies whether the value of this descriptor is readable and if so, under which constraints.
参见 setWritePermissions().
void QLowEnergyDescriptorData::setUuid(const QBluetoothUuid &uuid)
Sets the UUID of this descriptor to uuid.
参见 uuid().
void QLowEnergyDescriptorData::setValue(const QByteArray &value)
Sets the value of this descriptor to value. It will be sent to a peer device exactly the way it is provided here, so callers need to take care of things such as endianness.
参见 value().
void QLowEnergyDescriptorData::setWritePermissions(bool writable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints())
Specifies whether the value of this descriptor is writable and if so, under which constraints.
参见 setReadPermissions().
void QLowEnergyDescriptorData::swap(QLowEnergyDescriptorData &other)
Swaps this object with other.
QBluetoothUuid QLowEnergyDescriptorData::uuid() const
Returns the UUID of this descriptor.
参见 setUuid().
QByteArray QLowEnergyDescriptorData::value() const
Returns the value of this descriptor.
参见 setValue().
QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::writeConstraints() const
Returns the constraints under which the value of this descriptor can be written. This value is only relevant if isWritable() returns true
.
QLowEnergyDescriptorData &QLowEnergyDescriptorData::operator=(const QLowEnergyDescriptorData &other)
Makes this object a copy of other and returns the new value of this object.