Add a bunch of Manager Methods for MQTT Commands

This commit is contained in:
Justin Hammond 2019-11-03 19:02:51 +08:00
parent ea376a48cd
commit 6a088c931b
67 changed files with 1272 additions and 13 deletions

View file

@ -0,0 +1,19 @@
#include "mqttcommands/requestConfigParam.h"
MqttCommand_RequestConfigParam::MqttCommand_RequestConfigParam(QObject *parent) :
MqttCommand(parent)
{
this->m_requiredFields << "node" << "param";
}
MqttCommand* MqttCommand_RequestConfigParam::Create(QObject *parent) {
return new MqttCommand_RequestConfigParam(parent);
}
bool MqttCommand_RequestConfigParam::processMessage(QJsonDocument msg) {
QTOZWManager *mgr = getOZWManager();
mgr->requestConfigParam(msg["node"].toInt(), msg["param"].toInt());
QJsonObject js;
js["status"] = "ok";
emit sendCommandUpdate(GetCommand(), js);
return true;
}