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