Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QLowEnergyDescriptorData Class Reference

The QLowEnergyDescriptorData class is used to create GATT service data. \inmodule QtBluetooth. More...

#include <qlowenergydescriptordata.h>

+ Collaboration diagram for QLowEnergyDescriptorData:

Public Member Functions

 QLowEnergyDescriptorData ()
 Creates a new invalid object of this class.
 
 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 (const QLowEnergyDescriptorData &other)
 Constructs a new object of this class that is a copy of other.
 
 ~QLowEnergyDescriptorData ()
 Destroys this object.
 
QLowEnergyDescriptorDataoperator= (const QLowEnergyDescriptorData &other)
 Makes this object a copy of other and returns the new value of this object.
 
QByteArray value () const
 Returns the value of this descriptor.
 
void setValue (const QByteArray &value)
 Sets the value of this descriptor to value.
 
QBluetoothUuid uuid () const
 Returns the UUID of this descriptor.
 
void setUuid (const QBluetoothUuid &uuid)
 Sets the UUID of this descriptor to uuid.
 
bool isValid () const
 Returns true if and only if this object has a non-null UUID.
 
void setReadPermissions (bool readable, QBluetooth::AttAccessConstraints constraints=QBluetooth::AttAccessConstraints())
 Specifies whether the value of this descriptor is readable and if so, under which constraints.
 
bool isReadable () const
 Returns true if the value of this descriptor is readable and false otherwise.
 
QBluetooth::AttAccessConstraints readConstraints () const
 Returns the constraints under which the value of this descriptor can be read.
 
void setWritePermissions (bool writable, QBluetooth::AttAccessConstraints constraints=QBluetooth::AttAccessConstraints())
 Specifies whether the value of this descriptor is writable and if so, under which constraints.
 
bool isWritable () const
 Returns true if the value of this descriptor is writable and false otherwise.
 
QBluetooth::AttAccessConstraints writeConstraints () const
 Returns the constraints under which the value of this descriptor can be written.
 
void swap (QLowEnergyDescriptorData &other) noexcept
 Swaps this object with other.
 

Friends

bool operator== (const QLowEnergyDescriptorData &a, const QLowEnergyDescriptorData &b)
 Returns true if a and b are equal with respect to their public state, otherwise returns false.
 
bool operator!= (const QLowEnergyDescriptorData &a, const QLowEnergyDescriptorData &b)
 Returns true if a and b are unequal with respect to their public state, otherwise returns false.
 

Detailed Description

The QLowEnergyDescriptorData class is used to create GATT service data. \inmodule QtBluetooth.

Since
5.7

An object of this class provides a descriptor to be added to a \l QLowEnergyCharacteristicData object via \l 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.
See also
QLowEnergyCharacteristicData
QLowEnergyServiceData
QLowEnergyController::addService

Definition at line 16 of file qlowenergydescriptordata.h.

Constructor & Destructor Documentation

◆ QLowEnergyDescriptorData() [1/3]

QLowEnergyDescriptorData::QLowEnergyDescriptorData ( )

Creates a new invalid object of this class.

Definition at line 42 of file qlowenergydescriptordata.cpp.

◆ QLowEnergyDescriptorData() [2/3]

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.

Definition at line 50 of file qlowenergydescriptordata.cpp.

References setUuid(), setValue(), and uuid().

+ Here is the call graph for this function:

◆ QLowEnergyDescriptorData() [3/3]

QLowEnergyDescriptorData::QLowEnergyDescriptorData ( const QLowEnergyDescriptorData & other)

Constructs a new object of this class that is a copy of other.

Definition at line 59 of file qlowenergydescriptordata.cpp.

◆ ~QLowEnergyDescriptorData()

QLowEnergyDescriptorData::~QLowEnergyDescriptorData ( )

Destroys this object.

Definition at line 65 of file qlowenergydescriptordata.cpp.

Member Function Documentation

◆ isReadable()

bool QLowEnergyDescriptorData::isReadable ( ) const

Returns true if the value of this descriptor is readable and false otherwise.

Definition at line 122 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::readable.

Referenced by setupDescPermissions().

+ Here is the caller graph for this function:

◆ isValid()

bool QLowEnergyDescriptorData::isValid ( ) const

Returns true if and only if this object has a non-null UUID.

Definition at line 104 of file qlowenergydescriptordata.cpp.

References QUuid::isNull(), and uuid().

Referenced by QLowEnergyCharacteristicData::addDescriptor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isWritable()

bool QLowEnergyDescriptorData::isWritable ( ) const

Returns true if the value of this descriptor is writable and false otherwise.

Definition at line 149 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::writable.

Referenced by setupDescPermissions().

+ Here is the caller graph for this function:

◆ operator=()

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

Makes this object a copy of other and returns the new value of this object.

Definition at line 70 of file qlowenergydescriptordata.cpp.

References other().

+ Here is the call graph for this function:

◆ readConstraints()

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::readConstraints ( ) const

Returns the constraints under which the value of this descriptor can be read.

This value is only relevant if \l isReadable() returns true.

Definition at line 131 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::readConstraints.

Referenced by setupDescPermissions().

+ Here is the caller graph for this function:

◆ setReadPermissions()

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.

See also
setWritePermissions()

Definition at line 114 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::readable, and QLowEnergyDescriptorDataPrivate::readConstraints.

◆ setUuid()

void QLowEnergyDescriptorData::setUuid ( const QBluetoothUuid & uuid)

Sets the UUID of this descriptor to uuid.

Definition at line 98 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::uuid, and uuid().

Referenced by QLowEnergyDescriptorData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValue()

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.

Definition at line 86 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::value, and value().

Referenced by QLowEnergyDescriptorData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWritePermissions()

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.

See also
setReadPermissions()

Definition at line 141 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::writable, and QLowEnergyDescriptorDataPrivate::writeConstraints.

◆ swap()

void QLowEnergyDescriptorData::swap ( QLowEnergyDescriptorData & other)
inlinenoexcept

Swaps this object with other.

Definition at line 54 of file qlowenergydescriptordata.h.

References d, and other().

+ Here is the call graph for this function:

◆ uuid()

QBluetoothUuid QLowEnergyDescriptorData::uuid ( ) const

Returns the UUID of this descriptor.

Definition at line 92 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::uuid.

Referenced by QLowEnergyDescriptorData(), isValid(), and setUuid().

+ Here is the caller graph for this function:

◆ value()

QByteArray QLowEnergyDescriptorData::value ( ) const

Returns the value of this descriptor.

Definition at line 77 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::value.

Referenced by setValue().

+ Here is the caller graph for this function:

◆ writeConstraints()

QBluetooth::AttAccessConstraints QLowEnergyDescriptorData::writeConstraints ( ) const

Returns the constraints under which the value of this descriptor can be written.

This value is only relevant if \l isWritable() returns true.

Definition at line 158 of file qlowenergydescriptordata.cpp.

References QLowEnergyDescriptorDataPrivate::writeConstraints.

Friends And Related Symbol Documentation

◆ operator!=

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

Returns true if a and b are unequal with respect to their public state, otherwise returns false.

Definition at line 31 of file qlowenergydescriptordata.h.

◆ operator==

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

Returns true if a and b are equal with respect to their public state, otherwise returns false.

Definition at line 26 of file qlowenergydescriptordata.h.


The documentation for this class was generated from the following files: