BluezQt::LEAdvertisement Class

class BluezQt::LEAdvertisement

Bluetooth LE advertisement. More...

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

Public Functions

LEAdvertisement(const QStringList &serviceUuids, QObject *parent = nullptr)
(since 6.1) QHash<quint16, QByteArray> manufacturerData() const
virtual void release()
(since 5.75) QHash<QString, QByteArray> serviceData() const
virtual QStringList serviceUuids() const
(since 6.1) void setManufacturerData(const QHash<quint16, QByteArray> &data)
(since 5.75) void setServiceData(const QHash<QString, QByteArray> &data)

Protected Functions

virtual QDBusObjectPath objectPath() const

Detailed Description

This class represents a Bluetooth LE advertisement.

Member Function Documentation

[explicit] LEAdvertisement::LEAdvertisement(const QStringList &serviceUuids, QObject *parent = nullptr)

Creates a new LEAdvertisement object with the given serviceUuids as a child of parent.

[since 6.1] QHash<quint16, QByteArray> LEAdvertisement::manufacturerData() const

Returns the manufacturer IDs and associated data included in the advertisement.

Keys are the manufacturer ID.

This function was introduced in 6.1.

See also setManufacturerData().

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

Returns the D-Bus object path of the advertisement.

The path where the advertisement will be registered.

Note: You must provide valid object path!

[virtual] void LEAdvertisement::release()

Indicates that the LEAdvertisement was unregistered.

This method gets called when the service daemon removes the Advertisement.

A client can use it to do cleanup tasks.

There is no need to call UnregisterAdvertisement because when this method gets called it has already been unregistered.

[since 5.75] QHash<QString, QByteArray> LEAdvertisement::serviceData() const

Returns the service data included in the advertisement.

This function was introduced in 5.75.

See also setServiceData().

[virtual] QStringList LEAdvertisement::serviceUuids() const

List of UUIDs to include in the "Service UUID" field of the Advertising Data.

[since 6.1] void LEAdvertisement::setManufacturerData(const QHash<quint16, QByteArray> &data)

Sets the manufacturer IDs and associated data to be included in the advertisement.

Keys are the manufacturer ID.

This function was introduced in 6.1.

See also manufacturerData().

[since 5.75] void LEAdvertisement::setServiceData(const QHash<QString, QByteArray> &data)

Sets the service data to include in the advertisement.

Keys are the UUIDs of the associated data.

This function was introduced in 5.75.

See also serviceData().