BluezQt

leadvertisingmanager.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_LEADVERTISINGMANAGER_H
10 #define BLUEZQT_LEADVERTISINGMANAGER_H
11 
12 #include <QObject>
13 
14 #include "bluezqt_export.h"
15 
16 namespace BluezQt
17 {
18 class LEAdvertisement;
19 class PendingCall;
20 
21 /**
22  * @class BluezQt::LEAdvertisingManager leadvertisingmanager.h <BluezQt/LEAdvertisingManager>
23  *
24  * Bluetooth LE advertising manager.
25  *
26  * The Advertising Manager allows external applications to register Advertisement
27  * Data which should be broadcast to devices. Advertisement Data elements must
28  * follow the API for LE Advertisement Data.
29  *
30  * @see LEAdvertisement
31  */
32 class BLUEZQT_EXPORT LEAdvertisingManager : public QObject
33 {
34  Q_OBJECT
35 
36 public:
37  /**
38  * Destroys an LEAdvertisingManager object.
39  */
40  ~LEAdvertisingManager() override;
41 
42  /**
43  * Registers advertisement.
44  *
45  * Registers an advertisement object to be sent over the LE Advertising
46  * channel. The service must be exported under interface LEAdvertisement1.
47  *
48  * InvalidArguments error indicates invalid or conflicting properties.
49  * InvalidLength error indicates that provided data results in too long data packet.
50  * The properties of this object are parsed on register, any changes are ignored.
51  * If the same object is registered twice it will result in an AlreadyExists error.
52  * NotPermitted error indicates that the maximum number of advertisements is reached.
53  *
54  * Possible errors: PendingCall::InvalidArguments, PendingCall::AlreadyExists,
55  * PendingCall::InvalidLength, PendingCall::NotPermitted
56  *
57  * @param advertisement advertisement to be registered
58  * @return void pending call
59  */
60  PendingCall *registerAdvertisement(LEAdvertisement *advertisement);
61 
62  /**
63  * Unregisters advertisement.
64  *
65  * This unregisters an advertisement that has been previously registered.
66  * The object path must match the same value that has been used on registration.
67  *
68  * Possible errors: PendingCall::InvalidArguments, PendingCall::DoesNotExist
69  *
70  * @param advertisement advertisement to be unregistered
71  * @return void pending call
72  */
73  PendingCall *unregisterAdvertisement(LEAdvertisement *advertisement);
74 
75 private:
76  explicit LEAdvertisingManager(const QString &path, QObject *parent = nullptr);
77 
78  class LEAdvertisingManagerPrivate *const d;
79 
80  friend class AdapterPrivate;
81 };
82 
83 } // namespace BluezQt
84 
85 #endif // BLUEZQT_LEADVERTISINGMANAGER_H
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.