Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/CommandParser/cmd.cpp
- Revision:
- 116:7337ed514891
- Parent:
- 102:715f754cf5a8
- Child:
- 117:a4a61da3de36
diff -r e900bd138bf3 -r 7337ed514891 src/CommandParser/cmd.cpp
--- a/src/CommandParser/cmd.cpp Thu Sep 22 16:10:01 2016 +0000
+++ b/src/CommandParser/cmd.cpp Thu Sep 22 21:09:49 2016 +0000
@@ -36,6 +36,7 @@
#include "global.h"
#include "ConfigurationHandler.h"
#include "ModbusMasterApi.h"
+#include "LogLocalApi.h"
#include "OutputTask.h"
#include "mDot.h"
#include "rtos.h"
@@ -55,7 +56,7 @@
// see cmd.h
const command_table_t cmdlist[] = {
{"?", "help command", cmd_help },
- //{"create-control", "create a control", cmd_create },
+ //{"create-control", "create a control", cmd_create },
{"cat", "cat a file", cmd_cat },
{"cif", "create a test input file", cmd_cif },
{"cmf", "create a manual control file", cmd_cmf },
@@ -82,6 +83,8 @@
{"time", "get current time", cmd_time },
{"sout", "set output", cmd_sout },
{"simin", "simulate input", cmd_simin },
+ {"deep", "dump EEP", cmd_deep },
+ {"peep", "push EEP", cmd_peep },
{NULL, NULL, NULL}
@@ -408,7 +411,7 @@
"\"halert\": \"115\","
"\"lalert\": \"85\", "
"\"hfs\": \"130\","
- "\"lfs\": \"70\", "
+ "\"lfs\": \"70\", "
"\"tol\": \"%s\" ", argv[2], argv[3], argv[4], argv[5], argv[6]
);
@@ -417,8 +420,8 @@
logInfo("(%d)save file failed, status=%d", __LINE__, status);
return;
}
-
- // send a message to the configuration handler to create the control
+
+ // send a message to the configuration handler to create the control
Message_t *msg = MailBox.alloc();
memset(msg, 0, sizeof(Message_t));
msg->action = ACTION_CREATE;
@@ -467,8 +470,8 @@
logInfo("(%d)save file failed, status=%d", __LINE__, status);
return;
}
-
- // send a message to the configuration handler to create the control
+
+ // send a message to the configuration handler to create the control
Message_t *msg = MailBox.alloc();
memset(msg, 0, sizeof(Message_t));
msg->action = ACTION_CREATE;
@@ -554,7 +557,7 @@
"\"setpoint\": \"2000.0\", "
"\"state\": \"1\", "
"\"percent\": \"100\", ", argv[2]
-
+
);
bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024);
@@ -889,7 +892,7 @@
printf("\rusage: sout <output> <value>\r\n");
printf("\rexample: sout o_rly1 1\r\n");
return;
- }
+ }
ModbusMasterWriteRegister( argv[1], value );
}
@@ -903,13 +906,13 @@
*****************************************************************************/
void cmd_settime(int argc, char **argv)
{
-
+
if ( argc != 7 ) {
printf("\rusage: set-time <yyyy> <mm> <dd> <hh> <mm> <ss>\n");
printf("\rexample: set-time 2016 12 25 12 0 0\r\n");
return;
}
-
+
rtc_set_time(atoi(argv[1]), // year
atoi(argv[2]), // month
atoi(argv[3]), // day
@@ -937,7 +940,7 @@
}
SimulateInputMap[argv[1]].start_value = atof(argv[2]);
-
+
ModbusRegisterMap[argv[1]].simulated = true;
if ( argc < 3 ) {
@@ -949,4 +952,32 @@
SimulateInputMap[argv[1]].max = atof(argv[4]);
SimulateInputMap[argv[1]].step = atof(argv[5]);
+}
+
+void cmd_deep( int argc, char **argv )
+{
+ UNUSED(argc);
+ UNUSED(argv);
+
+ char logString[128];
+
+ LogLocalApi_PopEntry( logString );
+ if( logString[0] != '\0' )
+ {
+ printf("%s\r\n", logString );
+ }
+ else
+ {
+ printf("%s\r\n", "No String Found" );
+ }
+}
+
+void cmd_peep( int argc, char **argv )
+{
+ UNUSED(argc);
+ UNUSED(argv);
+
+ std::string logString = "This is a string to log";
+
+ LogLocalApi_PushEntry( logString.c_str() );
}
\ No newline at end of file
