Add experience mode plugins

pull/228/head
Michael Zanetti 2019-10-10 11:39:51 +02:00
parent 5e3bc2acbd
commit f1ca2a5b86
8 changed files with 66 additions and 2 deletions

View File

@ -0,0 +1,11 @@
#include "experiencemanager.h"
#include "jsonrpc/jsonrpcserver.h"
namespace nymeaserver {
ExperienceManager::ExperienceManager(JsonRPCServer *jsonRpcServer, QObject *parent) : QObject(parent)
{
// jsonRpcServer->registerHandler();
}
}

View File

@ -0,0 +1,22 @@
#ifndef EXPERIENCEMANAGER_H
#define EXPERIENCEMANAGER_H
#include <QObject>
namespace nymeaserver {
class JsonRPCServer;
class ExperienceManager : public QObject
{
Q_OBJECT
public:
explicit ExperienceManager(JsonRPCServer *jsonRpcServer, QObject *parent = nullptr);
signals:
public slots:
};
}
#endif // EXPERIENCEMANAGER_H

View File

@ -71,6 +71,8 @@ public:
void registerTransportInterface(TransportInterface *interface, bool authenticationRequired);
void unregisterTransportInterface(TransportInterface *interface);
void registerHandler(JsonHandler *handler);
private:
QHash<QString, JsonHandler *> handlers() const;
@ -117,8 +119,6 @@ private:
int m_notificationId;
void registerHandler(JsonHandler *handler);
QString formatAssertion(const QString &targetNamespace, const QString &method, QMetaMethod::MethodType methodType, JsonHandler *handler, const QVariantMap &data) const;
};

View File

@ -18,6 +18,7 @@ RESOURCES += $$top_srcdir/icons.qrc \
HEADERS += nymeacore.h \
devices/devicemanagerimplementation.h \
devices/translator.h \
experiences/experiencemanager.h \
ruleengine/ruleengine.h \
ruleengine/rule.h \
ruleengine/stateevaluator.h \
@ -95,6 +96,7 @@ HEADERS += nymeacore.h \
SOURCES += nymeacore.cpp \
devices/devicemanagerimplementation.cpp \
devices/translator.cpp \
experiences/experiencemanager.cpp \
ruleengine/ruleengine.cpp \
ruleengine/rule.cpp \
ruleengine/stateevaluator.cpp \

View File

@ -171,6 +171,9 @@ void NymeaCore::init() {
qCDebug(dcApplication) << "Creating Cloud Manager";
m_cloudManager = new CloudManager(m_configuration, m_networkManager, this);
qCDebug(dcApplication()) << "Loading experiences";
CloudNotifications *cloudNotifications = m_cloudManager->createNotificationsPlugin();
m_deviceManager->registerStaticPlugin(cloudNotifications, cloudNotifications->metaData());

View File

@ -0,0 +1,6 @@
#include "experienceplugin.h"
ExperiencePlugin::ExperiencePlugin(QObject *parent) : JsonHandler(parent)
{
}

View File

@ -0,0 +1,18 @@
#ifndef EXPERIENCEPLUGIN_H
#define EXPERIENCEPLUGIN_H
#include <QObject>
#include "jsonrpc/jsonhandler.h"
class ExperiencePlugin : public JsonHandler
{
Q_OBJECT
public:
explicit ExperiencePlugin(QObject *parent = nullptr);
signals:
public slots:
};
#endif // EXPERIENCEPLUGIN_H

View File

@ -26,6 +26,7 @@ HEADERS += \
devices/browseresult.h \
jsonrpc/jsonhandler.h \
jsonrpc/jsonreply.h \
experiences/experienceplugin.h \
libnymea.h \
platform/package.h \
platform/repository.h \
@ -102,6 +103,7 @@ SOURCES += \
devices/browseresult.cpp \
jsonrpc/jsonhandler.cpp \
jsonrpc/jsonreply.cpp \
experiences/experienceplugin.cpp \
loggingcategories.cpp \
nymeasettings.cpp \
platform/package.cpp \