QLowEnergyCharacteristic Class

The QLowEnergyCharacteristic class stores information about a Bluetooth Low Energy service characteristic. More...

Header: #include <QLowEnergyCharacteristic>
qmake: QT += bluetooth
Since: Qt 5.4

This class was introduced in Qt 5.4.

Public Types

enum PropertyType { Unknown, Broadcasting, Read, WriteNoResponse, Write, …, ExtendedProperty }

Detailed Description

QLowEnergyCharacteristic provides information about a Bluetooth Low Energy service characteristic's name(), uuid(), value(), properties(), handle() and descriptors(). To obtain the characteristic's specification and information, it is necessary to connect to the device using the QLowEnergyService and QLowEnergyController classes.

The characteristic value may be written via the QLowEnergyService instance that manages the service to which this characteristic belongs. The QLowEnergyService::writeCharacteristic() function writes the new value. The QLowEnergyService::characteristicWritten() signal is emitted upon success. The value() of this object is automatically updated accordingly.

Characteristics may contain none, one or more descriptors. They can be individually retrieved using the descriptor() function. The descriptors() function returns all descriptors as a list. The general purpose of a descriptor is to add contextual information to the characteristic. For example, the descriptor might provide format or range information specifying how the characteristic's value is to be interpreted.

See also QLowEnergyService and QLowEnergyDescriptor.

Member Type Documentation

enum QLowEnergyCharacteristic::PropertyType

This enum describes the properties of a characteristic.

ConstantValueDescription
QLowEnergyCharacteristic::Unknown0x00The type is not known.
QLowEnergyCharacteristic::Broadcasting0x01Allow for the broadcasting of Generic Attributes (GATT) characteristic values.
QLowEnergyCharacteristic::Read0x02Allow the characteristic values to be read.
QLowEnergyCharacteristic::WriteNoResponse0x04Allow characteristic values without responses to be written.
QLowEnergyCharacteristic::Write0x08Allow for characteristic values to be written.
QLowEnergyCharacteristic::Notify0x10Permits notification of characteristic values.
QLowEnergyCharacteristic::Indicate0x20Permits indications of characteristic values.
QLowEnergyCharacteristic::WriteSigned0x40Permits signed writes of the GATT characteristic values.
QLowEnergyCharacteristic::ExtendedProperty0x80Additional characteristic properties are defined in the characteristic's extended properties descriptor.

See also properties().