BluezQt::GattCharacteristic Class

class BluezQt::GattCharacteristic
Header: #include <BluezQt/GattCharacteristic>
CMake: find_package(KF6 REQUIRED COMPONENTS BluezQt)
target_link_libraries(mytarget PRIVATE KF6::BluezQt)
Inherits: QObject

Public Functions

GattCharacteristic(const QString &uuid, BluezQt::GattService *service)
(since 6.0) GattCharacteristic(const QString &uuid, const QStringList &flags, BluezQt::GattService *service)
(since 6.0) QStringList flags() const
(since 6.0) bool isNotifying() const
QByteArray readValue()
const BluezQt::GattService *service() const
(since 6.0) void startNotify()
(since 6.0) void stopNotify()
QString uuid() const
void writeValue(const QByteArray &value)

Signals

void valueWritten(const QByteArray &value)

Protected Functions

virtual QDBusObjectPath objectPath() const

Detailed Description

Member Function Documentation

[explicit] GattCharacteristic::GattCharacteristic(const QString &uuid, BluezQt::GattService *service)

Creates a new GattCharacteristic object with the given uuid and a parent service.

This constructor creates a characteristic with the Read and Write flags set.

[since 6.0] GattCharacteristic::GattCharacteristic(const QString &uuid, const QStringList &flags, BluezQt::GattService *service)

Creates a new GattCharacteristic object with the given uuid and a parent service.

The flags can be used to indicate the characteristic usage.

This function was introduced in 6.0.

[since 6.0] QStringList GattCharacteristic::flags() const

Returns flags associated with this characteristic.

This function was introduced in 6.0.

[since 6.0] bool GattCharacteristic::isNotifying() const

Indicates if this characteristic currently has notifications enabled.

This function was introduced in 6.0.

[virtual protected] QDBusObjectPath GattCharacteristic::objectPath() const

Returns the D-Bus object path of the GattCharacteristic.

The path where the GattCharacteristic will be registered.

Note: You must provide valid object path!

QByteArray GattCharacteristic::readValue()

Reads the value of the characteristic.

const BluezQt::GattService *GattCharacteristic::service() const

The GATT service the characteristic belongs to.

[since 6.0] void GattCharacteristic::startNotify()

Enables notifications for this characteristic, if supported. Does nothing otherwise.

This function was introduced in 6.0.

[since 6.0] void GattCharacteristic::stopNotify()

Disables notifications for this characteristic.

This function was introduced in 6.0.

QString GattCharacteristic::uuid() const

Returns the 128-bit GATT characteristic UUID.

[signal] void GattCharacteristic::valueWritten(const QByteArray &value)

Indicates that a value was written.

void GattCharacteristic::writeValue(const QByteArray &value)

Writes the value of the characteristic.