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.
| Constant | Value | Description |
|---|---|---|
QLowEnergyCharacteristic::Unknown | 0x00 | The type is not known. |
QLowEnergyCharacteristic::Broadcasting | 0x01 | Allow for the broadcasting of Generic Attributes (GATT) characteristic values. |
QLowEnergyCharacteristic::Read | 0x02 | Allow the characteristic values to be read. |
QLowEnergyCharacteristic::WriteNoResponse | 0x04 | Allow characteristic values without responses to be written. |
QLowEnergyCharacteristic::Write | 0x08 | Allow for characteristic values to be written. |
QLowEnergyCharacteristic::Notify | 0x10 | Permits notification of characteristic values. |
QLowEnergyCharacteristic::Indicate | 0x20 | Permits indications of characteristic values. |
QLowEnergyCharacteristic::WriteSigned | 0x40 | Permits signed writes of the GATT characteristic values. |
QLowEnergyCharacteristic::ExtendedProperty | 0x80 | Additional characteristic properties are defined in the characteristic's extended properties descriptor. |
See also properties().