From 072da88eee57e5d16f0b75c7b90c8a0bc6a60cb3 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Thu, 10 Jul 2014 11:56:26 +0200 Subject: Implemented ping, disconnect, reconnect in daemon --- daemon/dbusadaptor.cpp | 20 +++++++++++++++++++- daemon/dbusadaptor.h | 14 +++++++++++--- daemon/manager.h | 5 +++++ daemon/org.pebbled.xml | 5 +++++ 4 files changed, 40 insertions(+), 4 deletions(-) (limited to 'daemon') diff --git a/daemon/dbusadaptor.cpp b/daemon/dbusadaptor.cpp index 6460dca..6125ee7 100644 --- a/daemon/dbusadaptor.cpp +++ b/daemon/dbusadaptor.cpp @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -a daemon/dbusadaptor -p app/daemonproxy daemon/org.pebbled.xml + * Command line was: qdbusxml2cpp -a dbusadaptor org.pebbled.xml * * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * @@ -57,3 +57,21 @@ QVariantMap PebbledAdaptor::pebble() const return qvariant_cast< QVariantMap >(parent()->property("pebble")); } +void PebbledAdaptor::disconnect() +{ + // handle method call org.pebbled.disconnect + QMetaObject::invokeMethod(parent(), "disconnect"); +} + +void PebbledAdaptor::ping(int val) +{ + // handle method call org.pebbled.ping + QMetaObject::invokeMethod(parent(), "ping", Q_ARG(int, val)); +} + +void PebbledAdaptor::reconnect() +{ + // handle method call org.pebbled.reconnect + QMetaObject::invokeMethod(parent(), "reconnect"); +} + diff --git a/daemon/dbusadaptor.h b/daemon/dbusadaptor.h index d1662c6..7613fba 100644 --- a/daemon/dbusadaptor.h +++ b/daemon/dbusadaptor.h @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -a daemon/dbusadaptor -p app/daemonproxy daemon/org.pebbled.xml + * Command line was: qdbusxml2cpp -a dbusadaptor org.pebbled.xml * * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * @@ -9,8 +9,8 @@ * before re-generating it. */ -#ifndef DBUSADAPTOR_H_1404660047 -#define DBUSADAPTOR_H_1404660047 +#ifndef DBUSADAPTOR_H_1404986135 +#define DBUSADAPTOR_H_1404986135 #include #include @@ -40,6 +40,11 @@ class PebbledAdaptor: public QDBusAbstractAdaptor " \n" " \n" " \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" "") public: @@ -60,6 +65,9 @@ public: // PROPERTIES QVariantMap pebble() const; public Q_SLOTS: // METHODS + void disconnect(); + void ping(int val); + void reconnect(); Q_SIGNALS: // SIGNALS void connectedChanged(); void pebbleChanged(); diff --git a/daemon/manager.h b/daemon/manager.h index b9aa01b..8d3c8de 100644 --- a/daemon/manager.h +++ b/daemon/manager.h @@ -71,6 +71,11 @@ class PebbledProxy : public QObject public: explicit PebbledProxy(QObject *parent) : QObject(parent) {} +public slots: + void ping(int val) { static_cast(parent())->watch->ping((unsigned int)val); } + void disconnect() { static_cast(parent())->watch->disconnect(); } + void reconnect() { static_cast(parent())->watch->reconnect(); } + }; #endif // MANAGER_H diff --git a/daemon/org.pebbled.xml b/daemon/org.pebbled.xml index a282815..0a958c8 100644 --- a/daemon/org.pebbled.xml +++ b/daemon/org.pebbled.xml @@ -10,5 +10,10 @@ + + + + + -- cgit v1.2.3