Missing Files (#22)

* Missing Files
This commit is contained in:
Justin Hammond 2020-01-22 00:31:31 +08:00 committed by GitHub
parent e26e6660a1
commit bcf82abe85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,18 @@
#include "mqttcommands/disablePoll.h"
MqttCommand_DisablePoll::MqttCommand_DisablePoll(QObject *parent) :
MqttCommand(parent)
{
this->m_requiredIntFields << "ValueIDKey";
}
MqttCommand* MqttCommand_DisablePoll::Create(QObject *parent) {
return new MqttCommand_DisablePoll(parent);
}
bool MqttCommand_DisablePoll::processMessage(rapidjson::Document &msg) {
if (!this->checkValue(msg, "ValueIDKey")) {
return this->sendSimpleStatus(false, "Invalid ValueIDKey Number");
}
QTOZWManager *mgr = getOZWManager();
return this->sendSimpleStatus(mgr->disablePoll(msg["ValueIdKey"].GetUint64()));
}

View file

@ -0,0 +1,17 @@
#ifndef DISABLEPOLL_H
#define DISABLEPOLL_H
#include "mqttcommands/mqttcommands.h"
class MqttCommand_DisablePoll : public MqttCommand {
Q_OBJECT
public:
static MqttCommand *Create(QObject *parent = nullptr);
static QString StaticGetCommand() { return "disablePoll";};
QString GetCommand() override { return StaticGetCommand(); };
bool processMessage(rapidjson::Document &) override;
private:
MqttCommand_DisablePoll(QObject *parent = nullptr);
};
#endif // PING_H