forked from librepods-org/librepods
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBluetoothMonitor.h
More file actions
34 lines (26 loc) · 992 Bytes
/
Copy pathBluetoothMonitor.h
File metadata and controls
34 lines (26 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef BLUETOOTHMONITOR_H
#define BLUETOOTHMONITOR_H
#include <QObject>
#include <QtDBus/QtDBus>
// Forward declarations for D-Bus types
typedef QMap<QDBusObjectPath, QMap<QString, QVariantMap>> ManagedObjectList;
Q_DECLARE_METATYPE(ManagedObjectList)
class BluetoothMonitor : public QObject, protected QDBusContext
{
Q_OBJECT
public:
explicit BluetoothMonitor(QObject *parent = nullptr);
~BluetoothMonitor();
bool checkAlreadyConnectedDevices();
signals:
void deviceConnected(const QString &macAddress, const QString &deviceName);
void deviceDisconnected(const QString &macAddress, const QString &deviceName);
private slots:
void onPropertiesChanged(const QString &interface, const QVariantMap &changedProps, const QStringList &invalidatedProps);
private:
QDBusConnection m_dbus;
void registerDBusService();
bool isAirPodsDevice(const QString &devicePath);
QString getDeviceName(const QString &devicePath);
};
#endif // BLUETOOTHMONITOR_H