
Typical controller demo program based on Seeed Arch Max. Features: - Multi-thread architecture - Inter-thread message communication - Independent command shell using thread - HTTPD with CGI, WS, RPC - Key & value pair configuration load/save
Dependencies: CMDB EthernetInterface HTTPD dconfig mbed-rpc mbed-rtos mbed storage_on_flash
Diff: console.cpp
- Revision:
- 2:d7ffadba49b9
- Parent:
- 0:2ffd10976643
--- a/console.cpp Fri Apr 10 11:54:18 2015 +0000 +++ b/console.cpp Wed Jun 17 01:55:19 2015 +0000 @@ -15,11 +15,13 @@ #define CID_TEST 1 #define CID_FREE 2 #define CID_CFG_SET 3 -#define CID_CFG_SAVE 4 -#define CID_CFG_PRINT 5 -#define CID_IF_UP 6 -#define CID_IF_DOWN 7 -#define CID_IF_STAT 8 +#define CID_CFG_RESET 4 +#define CID_CFG_SAVE 5 +#define CID_CFG_PRINT 6 +#define CID_IF_UP 7 +#define CID_IF_DOWN 8 +#define CID_IF_STAT 9 + /** Sample User Command Dispatcher. * @@ -42,6 +44,11 @@ } _config.unlock_config(); break; + case CID_CFG_RESET : + _config.lock_config(); + _config.reset_default(); + _config.unlock_config(); + break; case CID_CFG_SAVE : _config.lock_config(); if (!_config.save_config()) { @@ -73,6 +80,7 @@ {"Test",SUBSYSTEM,CID_TEST,"" ,"* Test Subsystem"}, {"free",CID_TEST,CID_FREE,"" ,"show amount of free memory", ""}, {"cfgset",CID_TEST,CID_CFG_SET,"%s %s" ,"config set", "config_key value"}, + {"cfgreset",CID_TEST,CID_CFG_RESET,"" ,"config reset", ""}, {"cfgsave",CID_TEST,CID_CFG_SAVE,"" ,"config save to flash"}, {"cfgprint",CID_TEST,CID_CFG_PRINT,"" ,"print all config"}, {"ifup",CID_TEST,CID_IF_UP,"" ,"bring a network interface up"}, @@ -137,3 +145,4 @@ } } +