diff --git a/qt-ozwdaemon/mqttcommands/close.cpp b/qt-ozwdaemon/mqttcommands/close.cpp new file mode 100644 index 0000000..e29bfa4 --- /dev/null +++ b/qt-ozwdaemon/mqttcommands/close.cpp @@ -0,0 +1,15 @@ +#include "mqttcommands/close.h" + +MqttCommand_Close::MqttCommand_Close(QObject *parent) : + MqttCommand(parent) +{ +} +MqttCommand* MqttCommand_Close::Create(QObject *parent) { + return new MqttCommand_Close(parent); +} + +bool MqttCommand_Close::processMessage(rapidjson::Document &msg) { + Q_UNUSED(msg); + QTOZWManager *mgr = getOZWManager(); + return this->sendSimpleStatus(mgr->close()); +} \ No newline at end of file diff --git a/qt-ozwdaemon/mqttcommands/close.h b/qt-ozwdaemon/mqttcommands/close.h new file mode 100644 index 0000000..71e05fe --- /dev/null +++ b/qt-ozwdaemon/mqttcommands/close.h @@ -0,0 +1,17 @@ +#ifndef CLOSE_H +#define CLOSE_H + +#include "mqttcommands/mqttcommands.h" + +class MqttCommand_Close : public MqttCommand { + Q_OBJECT +public: + static MqttCommand *Create(QObject *parent = nullptr); + static QString StaticGetCommand() { return "Close";}; + QString GetCommand() override { return StaticGetCommand(); }; + bool processMessage(rapidjson::Document &) override; +private: + MqttCommand_Close(QObject *parent = nullptr); +}; + +#endif // CLOSE_H \ No newline at end of file