QLowEnergyCharacteristicData Class

The QLowEnergyCharacteristicData class is used to set up GATT service data. 更多...

头: #include <QLowEnergyCharacteristicData>
qmake: QT += bluetooth

公共函数

QLowEnergyCharacteristicData ()
QLowEnergyCharacteristicData (const QLowEnergyCharacteristicData & other )
~QLowEnergyCharacteristicData ()
void addDescriptor (const QLowEnergyDescriptorData & descriptor )
QList<QLowEnergyDescriptorData> descriptors () const
bool isValid () const
int maximumValueLength () const
int minimumValueLength () const
QLowEnergyCharacteristic::PropertyTypes properties () const
QBluetooth::AttAccessConstraints readConstraints () const
void setDescriptors (const QList<QLowEnergyDescriptorData> & descriptors )
void setProperties (QLowEnergyCharacteristic::PropertyTypes properties )
void setReadConstraints (QBluetooth::AttAccessConstraints constraints )
void setUuid (const QBluetoothUuid & uuid )
void setValue (const QByteArray & value )
void setValueLength (int minimum , int maximum )
void setWriteConstraints (QBluetooth::AttAccessConstraints constraints )
void swap (QLowEnergyCharacteristicData & other )
QBluetoothUuid uuid () const
QByteArray value () const
QBluetooth::AttAccessConstraints writeConstraints () const
QLowEnergyCharacteristicData & operator= (const QLowEnergyCharacteristicData & other )
bool operator!= (const QLowEnergyCharacteristicData & a , const QLowEnergyCharacteristicData & b )
bool operator== (const QLowEnergyCharacteristicData & a , const QLowEnergyCharacteristicData & b )

详细描述

An Object of this class provides a characteristic to be added to a QLowEnergyServiceData object via QLowEnergyServiceData::addCharacteristic ().

另请参阅 QLowEnergyServiceData and QLowEnergyController::addService .

成员函数文档编制

QLowEnergyCharacteristicData:: QLowEnergyCharacteristicData ()

Creates a new invalid object of this class.

QLowEnergyCharacteristicData:: QLowEnergyCharacteristicData (const QLowEnergyCharacteristicData & other )

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

QLowEnergyCharacteristicData:: ~QLowEnergyCharacteristicData ()

销毁此对象。

void QLowEnergyCharacteristicData:: addDescriptor (const QLowEnergyDescriptorData & descriptor )

添加 descriptor to the list of descriptors of this characteristic, if it is valid.

另请参阅 setDescriptors ().

QList < QLowEnergyDescriptorData > QLowEnergyCharacteristicData:: descriptors () const

Returns the descriptors of this characteristic.

另请参阅 setDescriptors ().

bool QLowEnergyCharacteristicData:: isValid () const

Returns true if and only if this characteristic is valid, that is, it has a non-null UUID.

int QLowEnergyCharacteristicData:: maximumValueLength () const

Returns the maximum length in bytes that the value of this characteristic can have. By default, there is no limit beyond the constraints of the data type.

int QLowEnergyCharacteristicData:: minimumValueLength () const

Returns the minimum length in bytes that the value of this characteristic can have. The default is zero.

QLowEnergyCharacteristic::PropertyTypes QLowEnergyCharacteristicData:: properties () const

Returns the properties of this characteristic.

另请参阅 setProperties ().

QBluetooth::AttAccessConstraints QLowEnergyCharacteristicData:: readConstraints () const

Returns the constraints needed for a client to read the value of this characteristic. If properties () does not include QLowEnergyCharacteristic::Read , this value is irrelevant. By default, there are no read constraints.

另请参阅 setReadConstraints ().

void QLowEnergyCharacteristicData:: setDescriptors (const QList < QLowEnergyDescriptorData > & descriptors )

Sets the descriptors of this characteristic to descriptors . Only valid descriptors are considered.

另请参阅 descriptors () 和 addDescriptor ().

void QLowEnergyCharacteristicData:: setProperties ( QLowEnergyCharacteristic::PropertyTypes properties )

Sets the properties of this characteristic to properties .

另请参阅 properties ().

void QLowEnergyCharacteristicData:: setReadConstraints ( QBluetooth::AttAccessConstraints constraints )

Specifies that clients need to fulfill constraints to read the value of this characteristic.

另请参阅 readConstraints ().

void QLowEnergyCharacteristicData:: setUuid (const QBluetoothUuid & uuid )

Sets the UUID of this characteristic to uuid .

另请参阅 uuid ().

void QLowEnergyCharacteristicData:: setValue (const QByteArray & value )

Sets the value of this characteristic to value .

另请参阅 value ().

void QLowEnergyCharacteristicData:: setValueLength ( int minimum , int maximum )

Specifies minimum and maximum to be the smallest and largest length, respectively, that the value of this characteristic can have. The unit is bytes. If minimum and maximum are equal, the characteristic has a fixed-length value.

void QLowEnergyCharacteristicData:: setWriteConstraints ( QBluetooth::AttAccessConstraints constraints )

Specifies that clients need to fulfill constraints to write the value of this characteristic.

另请参阅 writeConstraints ().

void QLowEnergyCharacteristicData:: swap ( QLowEnergyCharacteristicData & other )

Swaps this object with other .

QBluetoothUuid QLowEnergyCharacteristicData:: uuid () const

Returns the UUID of this characteristic.

另请参阅 setUuid ().

QByteArray QLowEnergyCharacteristicData:: value () const

Returns the value of this characteristic.

另请参阅 setValue ().

QBluetooth::AttAccessConstraints QLowEnergyCharacteristicData:: writeConstraints () const

Returns the constraints needed for a client to write the value of this characteristic. If properties () does not include either of QLowEnergyCharacteristic::Write , QLowEnergyCharacteristic::WriteNoResponse and QLowEnergyCharacteristic::WriteSigned , this value is irrelevant. By default, there are no write constraints.

另请参阅 setWriteConstraints ().

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

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

相关非成员

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

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

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

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