1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <mincequi@web.de>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#ifndef BLUEZQT_GATTAPPLICATION_H
10#define BLUEZQT_GATTAPPLICATION_H
11
12#include <QObject>
13
14#include "bluezqt_export.h"
15
16#include <memory>
17
18class QDBusObjectPath;
19
20namespace BluezQt
21{
22/*!
23 * \inmodule BluezQt
24 * \class BluezQt::GattApplication
25 * \inheaderfile BluezQt/GattApplication
26 *
27 * \brief Bluetooth GattApplication.
28 *
29 * This class represents a Bluetooth GattApplication, which is the root node of
30 * a GATT object hierarchy. Its child nodes can be GattServices,
31 * GattCharacteristics and GattDescriptors that belong to that GattApplication.
32 * The object path prefix for GattApplications is freely definable and its
33 * children's paths follow the application path hierarchy automatically, while
34 * all instances are enumerated automatically as well.
35 *
36 * Object path: [variable prefix]/appXX/serviceYY/charZZ
37 *
38 */
39class BLUEZQT_EXPORT GattApplication : public QObject
40{
41 Q_OBJECT
42
43public:
44 /*!
45 * Creates a new GattApplication object with default object path prefix as a child of \a parent.
46 *
47 * Object path: /org/kde/bluezqt/appXX/serviceYY/charZZ
48 */
49 explicit GattApplication(QObject *parent = nullptr);
50
51 /*!
52 * Creates a new GattApplication object with custom object path prefix \a objectPathPrefix as a child of \a parent.
53 *
54 * Object path: [objectPathPrefix]/appXX/serviceYY/charZZ
55 */
56 explicit GattApplication(const QString &objectPathPrefix, QObject *parent = nullptr);
57
58 ~GattApplication() override;
59
60private:
61 /*
62 * Returns the D-Bus object path of the GATT application.
63 *
64 * The path where the GATT application will be registered.
65 *
66 * Note: You must provide valid object path!
67 */
68 virtual QDBusObjectPath objectPath() const;
69
70 std::unique_ptr<class GattApplicationPrivate> const d;
71
72 friend class GattManager;
73 friend class GattService;
74 friend class ObjectManagerAdaptor;
75};
76
77} // namespace BluezQt
78
79#endif
80

source code of bluez-qt/src/gattapplication.h