BluezQt

leadvertisement.h
1 /*
2  * BluezQt - Asynchronous BlueZ wrapper library
3  *
4  * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #ifndef BLUEZQT_LEADVERTISEMENT_H
10 #define BLUEZQT_LEADVERTISEMENT_H
11 
12 #include <QObject>
13 
14 #include "bluezqt_export.h"
15 
16 class QDBusObjectPath;
17 
18 namespace BluezQt
19 {
20 /**
21  * @class BluezQt::LEAdvertisement leadvertisement.h <BluezQt/LEAdvertisement>
22  *
23  * Bluetooth LE advertisement.
24  *
25  * This class represents a Bluetooth LE advertisement.
26  */
27 class BLUEZQT_EXPORT LEAdvertisement : public QObject
28 {
29  Q_OBJECT
30 
31 public:
32  /**
33  * Creates a new LEAdvertisement object.
34  *
35  * @param parent
36  */
37  explicit LEAdvertisement(const QStringList &serviceUuids, QObject *parent = nullptr);
38 
39  /**
40  * Destroys a LEAdvertisement object.
41  */
42  ~LEAdvertisement() override;
43 
44  /**
45  * List of UUIDs to include in the "Service UUID" field of the Advertising Data.
46  *
47  * @return UUIDs of the advertisement
48  */
49  virtual QStringList serviceUuids() const;
50 
51  /**
52  * Returns the service data included in the advertisement.
53  *
54  * @since 5.75
55  */
56  QHash<QString, QByteArray> serviceData() const;
57 
58  /**
59  * Sets the service data to include in the advertisement.
60  * Keys are the UUIDs of the associated data.
61  *
62  * @since 5.75
63  */
64  void setServiceData(const QHash<QString, QByteArray> &data);
65 
66  /**
67  * Indicates that the LEAdvertisement was unregistered.
68  *
69  * This method gets called when the service daemon removes the Advertisement.
70  * A client can use it to do cleanup tasks. There is no need to call
71  * UnregisterAdvertisement because when this method gets called it has
72  * already been unregistered.
73  */
74  virtual void release();
75 
76 protected:
77  /**
78  * D-Bus object path of the advertisement.
79  *
80  * The path where the advertisement will be registered.
81  *
82  * @note You must provide valid object path!
83  *
84  * @return object path of advertisement
85  */
86  virtual QDBusObjectPath objectPath() const;
87 
88 private:
89  class LEAdvertisementPrivate *const d;
90 
91  friend class LEAdvertisingManager;
92 };
93 
94 } // namespace BluezQt
95 
96 #endif // BLUEZQT_LEADVERTISEMENT_H
virtual void release(quint64 objid)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.