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:
- 169:c503848823aa
- Parent:
- 161:500f03d11fc4
- Child:
- 170:f9406996ff5b
--- a/src/CommandParser/cmd.cpp Mon Oct 03 18:10:31 2016 +0000 +++ b/src/CommandParser/cmd.cpp Mon Oct 03 21:33:58 2016 +0000 @@ -63,9 +63,9 @@ {"cmf", "create a manual control file", cmd_cmf }, {"cmt", "create multiple timers", cmd_cmt }, {"cof", "create a test output file", cmd_cof }, - {"create-manual", "create a manual control", cmd_createManual }, - {"create-setpoint", "create a setpoint control", cmd_createSetpoint }, - {"create-timer", "create a timer control", cmd_createTimer }, + {"create-mn", "create a manual control", cmd_createManual }, + {"create-sp", "create a setpoint control", cmd_createSetpoint }, + {"create-tm", "create a timer control", cmd_createTimer }, {"deep", "dump EEP", cmd_deep }, {"destroy-control", "destroy a control", cmd_destroy }, {"heap", "show heap statistics", cmd_heap }, @@ -404,9 +404,9 @@ *****************************************************************************/ void cmd_createSetpoint(int argc, char **argv) { - if ( argc != 7 ) { - printf("\rusage: create-setpoint <filename> <id> <input> <output> <direction> <tolerance>\n"); - printf("\rexample: create-setpoint control_sp_1.json SPC_01 i_tra01 o_rly1 1 5\r\n"); + if ( argc != 8 ) { + printf("\rusage: create-sp <filename> <id> <input> <output> <sp> <dir> <tol>\n"); + printf("\rexample: create-sp control_sp_1.json bd i_cond o_rly1 2000 1 15\n"); return; } @@ -422,15 +422,14 @@ "\"priority\": \"800\"," "\"input\": \"%s\", " "\"output\": \"%s\", " - "\"setpoint\": \"100\"," + "\"setpoint\": \"%s\"," "\"prodfact\": \"100\"," "\"actingDir\": \"%s\", " "\"halert\": \"115\"," "\"lalert\": \"85\", " "\"hfs\": \"130\"," "\"lfs\": \"70\", " - "\"tol\": \"%s\" }", argv[2], argv[3], argv[4], argv[5], argv[6] - ); + "\"tol\": \"%s\" }", argv[2], argv[3], argv[4], argv[5], argv[6], argv[7]); bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024); if( status != true ) { @@ -636,9 +635,9 @@ *****************************************************************************/ void cmd_cif(int argc, char **argv) { - if ( argc != 3 ) { - printf("\rusage: cif <filename> <input>\r\n"); - printf("\rexampe: cif input_i_tra01.json i_tra01\n"); + if ( argc != 6 ) { + printf("\rusage: cif <fname> <input> <name> <node> <reg>\n"); + printf("\rexample: cif input_i_tra01.json i_tra01 Trasar 5 2\n"); return; } @@ -646,19 +645,18 @@ snprintf(data_buf, sizeof(data_buf), "{ " "\"id\": \"%s\", " - "\"name\": \"TRASAR\", " + "\"name\": \"%s\", " "\"units\": \"PPM\", " "\"min\": \"0\", " "\"max\": \"300\", " - "\"node\": \"1\", " - "\"reg\": \"9\", " + "\"node\": \"%s\", " + "\"reg\": \"%s\", " "\"rtype\": \"1\", " "\"type\": \"0\", " "\"size\": \"2\", " "\"order\": \"2\", " "\"rfreq\": \"5\", " - "\"fmt\": \"%%.2f\" } ", argv[2] - ); + "\"fmt\": \"%%.2f\" } ", argv[2], argv[3], argv[4], argv[5]); bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024); if( status != true ) {