1/*
2 * BluezQt - Asynchronous Bluez wrapper library
3 *
4 * SPDX-FileCopyrightText: 2014 David Rosca <nowrep@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#ifndef BLUEZQT_DEVICE_P_H
10#define BLUEZQT_DEVICE_P_H
11
12#include <QObject>
13#include <QStringList>
14
15#include "bluezdevice1.h"
16#include "bluezqt_dbustypes.h"
17#include "dbusproperties.h"
18#include "types.h"
19
20namespace BluezQt
21{
22typedef org::bluez::Device1 BluezDevice;
23typedef org::freedesktop::DBus::Properties DBusProperties;
24
25class DevicePrivate : public QObject
26{
27 Q_OBJECT
28
29public:
30 explicit DevicePrivate(const QString &path, const QVariantMap &properties, const AdapterPtr &adapter);
31
32 void init(const QVariantMap &properties);
33
34 void interfacesAdded(const QString &path, const QVariantMapMap &interfaces);
35 void interfacesRemoved(const QString &path, const QStringList &interfaces);
36
37 void addGattService(const QString &gattServicePath, const QVariantMap &properties);
38 void removeGattService(const QString &gattServicePath);
39
40 QDBusPendingReply<> setDBusProperty(const QString &name, const QVariant &value);
41 void propertiesChanged(const QString &path, const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
42 void namePropertyChanged(const QString &value);
43 void aliasPropertyChanged(const QString &value);
44 void addressPropertyChanged(const QString &value);
45 void classPropertyChanged(quint32 value);
46 void serviceDataChanged(const QHash<QString, QByteArray> &value);
47
48 QWeakPointer<Device> q;
49 BluezDevice *m_bluezDevice;
50 DBusProperties *m_dbusProperties;
51
52 QString m_address;
53 QString m_name;
54 QString m_alias;
55 quint32 m_deviceClass;
56 quint16 m_appearance;
57 QString m_icon;
58 bool m_paired;
59 bool m_trusted;
60 bool m_blocked;
61 bool m_legacyPairing;
62 qint16 m_rssi;
63 ManData m_manufacturerData;
64 bool m_servicesResolved;
65 bool m_connected;
66 QStringList m_uuids;
67 QString m_modalias;
68 QHash<QString, QByteArray> m_serviceData;
69 BatteryPtr m_battery;
70 InputPtr m_input;
71 MediaPlayerPtr m_mediaPlayer;
72 MediaTransportPtr m_mediaTransport;
73 QList<GattServiceRemotePtr> m_services;
74 AdapterPtr m_adapter;
75};
76
77} // namespace BluezQt
78
79#endif // BLUEZQT_DEVICE_P_H
80

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