| 1 |
/* |
| 2 |
* BluezQt - Asynchronous Bluez wrapper library |
| 3 |
* |
| 4 |
* SPDX-FileCopyrightText: 2014 David Rosca <[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_ADAPTER_P_H |
| 10 |
#define BLUEZQT_ADAPTER_P_H |
| 11 |
|
| 12 |
#include <QObject> |
| 13 |
#include <QStringList> |
| 14 |
|
| 15 |
#include "bluezadapter1.h" |
| 16 |
#include "bluezqt_dbustypes.h" |
| 17 |
#include "dbusproperties.h" |
| 18 |
#include "types.h" |
| 19 |
|
| 20 |
namespace BluezQt |
| 21 |
{ |
| 22 |
typedef org::bluez::Adapter1 BluezAdapter; |
| 23 |
typedef org::freedesktop::DBus::Properties DBusProperties; |
| 24 |
|
| 25 |
class AdapterPrivate : public QObject |
| 26 |
{ |
| 27 |
Q_OBJECT |
| 28 |
|
| 29 |
public: |
| 30 |
explicit AdapterPrivate(const QString &path, const QVariantMap &properties); |
| 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 addDevice(const DevicePtr &device); |
| 38 |
void removeDevice(const DevicePtr &device); |
| 39 |
|
| 40 |
QDBusPendingReply<> setDBusProperty(const QString &name, const QVariant &value); |
| 41 |
void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated); |
| 42 |
|
| 43 |
QWeakPointer<Adapter> q; |
| 44 |
BluezAdapter *m_bluezAdapter; |
| 45 |
DBusProperties *m_dbusProperties; |
| 46 |
|
| 47 |
QString m_address; |
| 48 |
QString m_name; |
| 49 |
QString m_alias; |
| 50 |
quint32 m_adapterClass; |
| 51 |
bool m_powered; |
| 52 |
bool m_discoverable; |
| 53 |
quint32 m_discoverableTimeout; |
| 54 |
bool m_pairable; |
| 55 |
quint32 m_pairableTimeout; |
| 56 |
bool m_discovering; |
| 57 |
QStringList m_uuids; |
| 58 |
QList<DevicePtr> m_devices; |
| 59 |
QString m_modalias; |
| 60 |
MediaPtr m_media; |
| 61 |
GattManagerPtr m_gattManager; |
| 62 |
LEAdvertisingManagerPtr m_leAdvertisingManager; |
| 63 |
}; |
| 64 |
|
| 65 |
} // namespace BluezQt |
| 66 |
|
| 67 |
#endif // BLUEZQT_ADAPTER_P_H |