From 29aaea2d80a9eb1715b6cddfac2d2aacf76358bd Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 11 Feb 2016 23:55:16 +0100 Subject: launchpad ~mzanetti/rockwork/trunk r87 --- rockworkd/libpebble/bluez/bluezclient.h | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 rockworkd/libpebble/bluez/bluezclient.h (limited to 'rockworkd/libpebble/bluez/bluezclient.h') 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 +#include +#include + +#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 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 m_devices; +}; + +#endif // BLUEZCLIENT_H -- cgit v1.2.3