MicroLabo / Mbed OS mbed-Dot-AT-Firmware

Dependencies:   MTS-Serial libmDot-mbed5

Fork of Dot-AT-Firmware by MultiTech

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CmdEraseFlash.cpp Source File

CmdEraseFlash.cpp

00001 #include "CmdEraseFlash.h"
00002 
00003 CmdEraseFlash::CmdEraseFlash() :
00004         Command("Erase Entire Flash ", "AT+ERASE", "Erase all configurations saved in flash memory", "1")
00005 {
00006 }
00007 
00008 uint32_t CmdEraseFlash::action(std::vector<std::string> args)
00009 {
00010     CommandTerminal::Dot()->eraseFlash();
00011     return 0;
00012 }
00013 
00014 bool CmdEraseFlash::verify(std::vector<std::string> args)
00015 {
00016     if (args.size() == 2 && args[1] == "1")
00017         return true;
00018 
00019     CommandTerminal::setErrorMessage("Entire flash will be erased, please provide parameter of '1'");
00020     return false;
00021 }