QLowEnergyCharacteristicData#

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

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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

class PySide6.QtBluetooth.QLowEnergyCharacteristicData#

PySide6.QtBluetooth.QLowEnergyCharacteristicData(other)

Parameters:

otherPySide6.QtBluetooth.QLowEnergyCharacteristicData

Creates a new invalid object of this class.

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.addDescriptor(descriptor)#
Parameters:

descriptorPySide6.QtBluetooth.QLowEnergyDescriptorData

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

See also

setDescriptors()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.descriptors()#
Return type:

.list of QLowEnergyDescriptorData

Returns the descriptors of this characteristic.

See also

setDescriptors()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.isValid()#
Return type:

bool

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.maximumValueLength()#
Return type:

int

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.

PySide6.QtBluetooth.QLowEnergyCharacteristicData.minimumValueLength()#
Return type:

int

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.__ne__(b)#
Parameters:

bPySide6.QtBluetooth.QLowEnergyCharacteristicData

Return type:

bool

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.__eq__(b)#
Parameters:

bPySide6.QtBluetooth.QLowEnergyCharacteristicData

Return type:

bool

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.properties()#
Return type:

Combination of QLowEnergyCharacteristic.PropertyType

Returns the properties of this characteristic.

See also

setProperties()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.readConstraints()#
Return type:

Combination of QBluetooth.AttAccessConstraint

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setDescriptors(descriptors)#
Parameters:

descriptors – .list of QLowEnergyDescriptorData

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setProperties(properties)#
Parameters:

properties – Combination of QLowEnergyCharacteristic.PropertyType

Sets the properties of this characteristic to properties.

See also

properties()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setReadConstraints(constraints)#
Parameters:

constraints – Combination of QBluetooth.AttAccessConstraint

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setUuid(uuid)#
Parameters:

uuidPySide6.QtBluetooth.QBluetoothUuid

Sets the UUID of this characteristic to uuid.

See also

uuid()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setValue(value)#
Parameters:

valuePySide6.QtCore.QByteArray

Sets the value of this characteristic to value.

See also

value()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setValueLength(minimum, maximum)#
Parameters:
  • minimum – int

  • maximum – int

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.

PySide6.QtBluetooth.QLowEnergyCharacteristicData.setWriteConstraints(constraints)#
Parameters:

constraints – Combination of QBluetooth.AttAccessConstraint

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

PySide6.QtBluetooth.QLowEnergyCharacteristicData.swap(other)#
Parameters:

otherPySide6.QtBluetooth.QLowEnergyCharacteristicData

Swaps this object with other.

PySide6.QtBluetooth.QLowEnergyCharacteristicData.uuid()#
Return type:

PySide6.QtBluetooth.QBluetoothUuid

Returns the UUID of this characteristic.

See also

setUuid()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.value()#
Return type:

PySide6.QtCore.QByteArray

Returns the value of this characteristic.

See also

setValue()

PySide6.QtBluetooth.QLowEnergyCharacteristicData.writeConstraints()#
Return type:

Combination of QBluetooth.AttAccessConstraint

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