diff options
Diffstat (limited to 'CommandTerminal/CmdExit.cpp')
-rw-r--r-- | CommandTerminal/CmdExit.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CommandTerminal/CmdExit.cpp b/CommandTerminal/CmdExit.cpp new file mode 100644 index 0000000..46923b3 --- /dev/null +++ b/CommandTerminal/CmdExit.cpp @@ -0,0 +1,19 @@ +#include "CmdExit.h" + +CmdExit::CmdExit(mDot* dot, mts::MTSSerial& serial) : + Command(dot, "Exit", "AT+EXIT", "Exit from command mode to main menu"), _serial(serial) +{ + _help = std::string(text()) + ": " + std::string(desc()); +} + +uint32_t CmdExit::action(std::vector<std::string> args) +{ +//ToDo: Probably setting or clearing a flag to indicate to some other task to shut down command mode and display the main menu. + if (!_dot->saveConfig()) { + setErrorMessage("Failed to save to flash"); + return 1; + } + + return 0; + +} |