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_GATTSERVICE_H |
10 | #define BLUEZQT_GATTSERVICE_H |
11 | |
12 | #include "bluezqt_export.h" |
13 | #include "types.h" |
14 | |
15 | #include <QDBusObjectPath> |
16 | |
17 | #include <memory> |
18 | |
19 | namespace BluezQt |
20 | { |
21 | class GattApplication; |
22 | /*! |
23 | * \inmodule BluezQt |
24 | * \class BluezQt::GattService |
25 | * \inheaderfile BluezQt/GattService |
26 | * \brief Bluetooth GattService. |
27 | * |
28 | * This class represents a Bluetooth GattService. |
29 | */ |
30 | class BLUEZQT_EXPORT GattService : public QObject |
31 | { |
32 | Q_OBJECT |
33 | |
34 | public: |
35 | /*! |
36 | * Creates a new GattService object as a child of a \a parent application. |
37 | */ |
38 | explicit GattService(const QString &uuid, bool isPrimary, GattApplication *parent); |
39 | |
40 | ~GattService() override; |
41 | |
42 | /*! |
43 | * Returns the 128-bit service UUID. |
44 | */ |
45 | QString uuid() const; |
46 | |
47 | /*! |
48 | * Indicates whether or not this GATT service is a |
49 | * primary service. |
50 | * |
51 | * Returns \c true if this GATT service is primary, \c false if secondary. |
52 | */ |
53 | bool isPrimary() const; |
54 | |
55 | protected: |
56 | /*! |
57 | * Returns the D-Bus object path registered for the GattService. |
58 | * |
59 | * \note You must provide valid object path! |
60 | */ |
61 | virtual QDBusObjectPath objectPath() const; |
62 | |
63 | private: |
64 | std::unique_ptr<class GattServicePrivate> const d; |
65 | |
66 | friend class GattApplicationPrivate; |
67 | friend class GattCharacterisiticPrivate; |
68 | friend class GattCharacteristicAdaptor; |
69 | friend class GattManager; |
70 | }; |
71 | |
72 | } // namespace BluezQt |
73 | |
74 | #endif |
75 | |