diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2016-02-11 23:55:16 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2016-02-11 23:55:16 +0100 |
| commit | 29aaea2d80a9eb1715b6cddfac2d2aacf76358bd (patch) | |
| tree | 012795b6bec16c72f38d33cff46324c9a0225868 /rockworkd/libpebble/bluez/bluezclient.h | |
launchpad ~mzanetti/rockwork/trunk r87
Diffstat (limited to 'rockworkd/libpebble/bluez/bluezclient.h')
| -rw-r--r-- | rockworkd/libpebble/bluez/bluezclient.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/rockworkd/libpebble/bluez/bluezclient.h b/rockworkd/libpebble/bluez/bluezclient.h new file mode 100644 index 0000000..f8e5749 --- /dev/null +++ b/rockworkd/libpebble/bluez/bluezclient.h @@ -0,0 +1,51 @@ +#ifndef BLUEZCLIENT_H +#define BLUEZCLIENT_H + +#include <QList> +#include <QBluetoothAddress> +#include <QBluetoothLocalDevice> + +#include "bluez_helper.h" +#include "freedesktop_objectmanager.h" +#include "freedesktop_properties.h" +#include "bluez_adapter1.h" +#include "bluez_agentmanager1.h" + +class Device { +public: + QBluetoothAddress address; + QString name; + QString path; +}; + +class BluezClient: public QObject +{ + Q_OBJECT + +public: + BluezClient(QObject *parent = 0); + + + QList<Device> pairedPebbles() const; + +private slots: + void addDevice(const QDBusObjectPath &path, const QVariantMap &properties); + + void slotInterfacesAdded(const QDBusObjectPath&path, InterfaceList ifaces); + void slotInterfacesRemoved(const QDBusObjectPath&path, const QStringList &ifaces); + +signals: + void devicesChanged(); + +private: + QDBusConnection m_dbus; + DBusObjectManagerInterface m_bluezManager; + BluezAgentManager1 m_bluezAgentManager; + BluezAdapter1 *m_bluezAdapter = nullptr; + FreeDesktopProperties *m_bluezAdapterProperties = nullptr; + + + QHash<QString, Device> m_devices; +}; + +#endif // BLUEZCLIENT_H |
