BluezQt

gattmanager.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_GATTMANAGER_H
10 #define BLUEZQT_GATTMANAGER_H
11 
12 #include <QObject>
13 
14 #include "bluezqt_export.h"
15 
16 namespace BluezQt
17 {
18 class GattApplication;
19 class PendingCall;
20 
21 /**
22  * @class BluezQt::GattManager GattManager.h <BluezQt/GattManager>
23  *
24  * Bluetooth GattManager.
25  *
26  * GATT Manager allows external applications to register GATT services and
27  * profiles.
28  *
29  * Registering a profile allows applications to subscribe to *remote* services.
30  * These must implement the GattProfile1 interface defined above.
31  *
32  * Registering a service allows applications to publish a *local* GATT service,
33  * which then becomes available to remote devices. A GATT service is represented by
34  * a D-Bus object hierarchy where the root node corresponds to a service and the
35  * child nodes represent characteristics and descriptors that belong to that
36  * service. Each node must implement one of GattService1, GattCharacteristic1,
37  * or GattDescriptor1 interfaces described above, based on the attribute it
38  * represents. Each node must also implement the standard D-Bus Properties
39  * interface to expose their properties. These objects collectively represent a
40  * GATT service definition.
41  *
42  * @see GattApplication
43  */
44 class BLUEZQT_EXPORT GattManager : public QObject
45 {
46  Q_OBJECT
47 
48 public:
49  /**
50  * Destroys a GattManager object.
51  */
52  ~GattManager() override;
53 
54  /**
55  * Registers a local GATT services hierarchy as described
56  * above (GATT Server) and/or GATT profiles (GATT Client).
57  *
58  * The application object path together with the D-Bus
59  * system bus connection ID define the identification of
60  * the application registering a GATT based
61  * service or profile.
62  *
63  * Possible errors: org.bluez.Error.InvalidArguments
64  * org.bluez.Error.AlreadyExists
65  *
66  * @param application application to be registered
67  * @return void pending call
68  */
69  PendingCall *registerApplication(GattApplication *application);
70 
71  /**
72  * This unregisters the services that has been
73  * previously registered. The object path parameter
74  * must match the same value that has been used
75  * on registration.
76  *
77  * Possible errors: org.bluez.Error.InvalidArguments
78  * org.bluez.Error.DoesNotExist
79  *
80  * @param application application to be unregistered
81  * @return void pending call
82  */
83  PendingCall *unregisterApplication(GattApplication *application);
84 
85 private:
86  BLUEZQT_NO_EXPORT explicit GattManager(const QString &path, QObject *parent = nullptr);
87 
88  class GattManagerPrivate *const d;
89 
90  friend class AdapterPrivate;
91 };
92 
93 } // namespace BluezQt
94 
95 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Sep 25 2023 04:04:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.