class QLowEnergyCharacteristicData

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

Synopsis

Methods

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() .

__init__()

Creates a new invalid object of this class.

__init__(other)
Parameters:

otherQLowEnergyCharacteristicData

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

addDescriptor(descriptor)
Parameters:

descriptorQLowEnergyDescriptorData

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

See also

setDescriptors()

descriptors()
Return type:

.list of QLowEnergyDescriptorData

Returns the descriptors of this characteristic.

See also

setDescriptors()

isValid()
Return type:

bool

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

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.

minimumValueLength()
Return type:

int

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

__ne__(b)
Parameters:

bQLowEnergyCharacteristicData

Return type:

bool

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

__eq__(b)
Parameters:

bQLowEnergyCharacteristicData

Return type:

bool

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

properties()
Return type:

Combination of PropertyType

Returns the properties of this characteristic.

See also

setProperties()

readConstraints()
Return type:

Combination of 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.

setDescriptors(descriptors)
Parameters:

descriptors – .list of QLowEnergyDescriptorData

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

setProperties(properties)
Parameters:

properties – Combination of PropertyType

Sets the properties of this characteristic to properties.

See also

properties()

setReadConstraints(constraints)
Parameters:

constraints – Combination of AttAccessConstraint

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

setUuid(uuid)
Parameters:

uuidQBluetoothUuid

Sets the UUID of this characteristic to uuid.

See also

uuid()

setValue(value)
Parameters:

valueQByteArray

Sets the value of this characteristic to value.

See also

value()

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.

setWriteConstraints(constraints)
Parameters:

constraints – Combination of AttAccessConstraint

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

swap(other)
Parameters:

otherQLowEnergyCharacteristicData

Swaps this object with other.

uuid()
Return type:

QBluetoothUuid

Returns the UUID of this characteristic.

See also

setUuid()

value()
Return type:

QByteArray

Returns the value of this characteristic.

See also

setValue()

writeConstraints()
Return type:

Combination of 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.