qt-openzwave/qt-ozwdaemon/mqttcommands/requestNodeState.cpp

18 lines
No EOL
633 B
C++

#include "mqttcommands/requestNodeState.h"
MqttCommand_RequestNodeState::MqttCommand_RequestNodeState(QObject *parent) :
MqttCommand(parent)
{
this->m_requiredIntFields << "node";
}
MqttCommand* MqttCommand_RequestNodeState::Create(QObject *parent) {
return new MqttCommand_RequestNodeState(parent);
}
bool MqttCommand_RequestNodeState::processMessage(rapidjson::Document &msg) {
if (!this->checkNode(msg, "node")) {
return this->sendSimpleStatus(false, "Invalid Node Number");
}
QTOZWManager *mgr = getOZWManager();
return this->sendSimpleStatus(mgr->requestNodeState(msg["node"].GetUint()));
}