diff options
Diffstat (limited to 'CommandTerminal')
-rw-r--r-- | CommandTerminal/CmdWriteProtectedConfig.cpp | 17 | ||||
-rw-r--r-- | CommandTerminal/CmdWriteProtectedConfig.h | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/CommandTerminal/CmdWriteProtectedConfig.cpp b/CommandTerminal/CmdWriteProtectedConfig.cpp new file mode 100644 index 0000000..7609024 --- /dev/null +++ b/CommandTerminal/CmdWriteProtectedConfig.cpp @@ -0,0 +1,17 @@ +#include "CmdWriteProtectedConfig.h" + +CmdWriteProtectedConfig::CmdWriteProtectedConfig(mDot* dot) : + Command(dot, "Write Protected Config", "AT&WP", "Write protected config to flash (DeviceId and Frequency Band)") +{ + _help = std::string(text()) + ": " + std::string(desc()); +} + +uint32_t CmdWriteProtectedConfig::action(std::vector<std::string> args) +{ + if (!_dot->saveProtectedConfig()) { + setErrorMessage("Failed to save to flash"); + return 1; + } + + return 0; +} diff --git a/CommandTerminal/CmdWriteProtectedConfig.h b/CommandTerminal/CmdWriteProtectedConfig.h new file mode 100644 index 0000000..f31d2bd --- /dev/null +++ b/CommandTerminal/CmdWriteProtectedConfig.h @@ -0,0 +1,17 @@ + +#ifndef __CMDWRITEPROTECTEDCONFIG_H__ +#define __CMDWRITEPROTECTEDCONFIG_H__ + +#include "Command.h" + +class CmdWriteProtectedConfig : public Command { + +public: + + CmdWriteProtectedConfig(mDot* dot); + virtual uint32_t action(std::vector<std::string> args); + +private: +}; + +#endif // __CMDWRITEPROTECTEDCONFIG_H__ |