mirror of https://github.com/nymea/nymea.git
44 lines
881 B
C++
44 lines
881 B
C++
#include "hivecore.h"
|
|
#include "jsonrpcserver.h"
|
|
#include "devicemanager.h"
|
|
|
|
#include <QDebug>
|
|
|
|
HiveCore* HiveCore::s_instance = 0;
|
|
|
|
HiveCore *HiveCore::instance()
|
|
{
|
|
if (!s_instance) {
|
|
s_instance = new HiveCore();
|
|
}
|
|
return s_instance;
|
|
}
|
|
|
|
DeviceManager *HiveCore::deviceManager() const
|
|
{
|
|
return m_deviceManager;
|
|
}
|
|
|
|
HiveCore::HiveCore(QObject *parent) :
|
|
QObject(parent)
|
|
{
|
|
|
|
qDebug() << "creating devmanager";
|
|
m_deviceManager = new DeviceManager(this);
|
|
|
|
|
|
// start the server
|
|
m_jsonServer = new JsonRPCServer(this);
|
|
|
|
connect(m_deviceManager,SIGNAL(emitTrigger(QUuid,QVariantMap)),this,SLOT(gotSignal(QUuid,QVariantMap)));
|
|
|
|
}
|
|
|
|
void HiveCore::gotSignal(const QUuid &triggerId, const QVariantMap ¶ms)
|
|
{
|
|
qDebug() << "##################################################";
|
|
qDebug() << "id: " << triggerId;
|
|
qDebug() << params;
|
|
|
|
}
|