From 1d6bcd0116b9082f42035da8bb2be1868eb12dee Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Fri, 8 Jan 2016 10:05:04 -0600 Subject: add CmdWriteProtectedConfig --- CommandTerminal/CmdWriteProtectedConfig.cpp | 17 +++++++++++++++++ CommandTerminal/CmdWriteProtectedConfig.h | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 CommandTerminal/CmdWriteProtectedConfig.cpp create mode 100644 CommandTerminal/CmdWriteProtectedConfig.h (limited to 'CommandTerminal') 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 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 args); + +private: +}; + +#endif // __CMDWRITEPROTECTEDCONFIG_H__ -- cgit v1.2.3