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:
- 121:650205ffa656
- Parent:
- 118:2a131efdfd5a
- Child:
- 122:4db48b933115
--- a/src/CommandParser/cmd.cpp Thu Sep 22 21:30:48 2016 +0000 +++ b/src/CommandParser/cmd.cpp Fri Sep 23 12:45:49 2016 +0000 @@ -407,6 +407,11 @@ return; } + if ( strncmp(argv[1], CONTROL_SP_STR, strlen(CONTROL_SP_STR)) != 0 ) { + printf("\rFilename must be prefixed with control_sp_*\n"); + return; + } + char data_buf[1024]; snprintf(data_buf, sizeof(data_buf), "{ " @@ -420,7 +425,7 @@ "\"halert\": \"115\"," "\"lalert\": \"85\", " "\"hfs\": \"130\"," - "\"lfs\": \"70\", " + "\"lfs\": \"70\", " "\"tol\": \"%s\" }", argv[2], argv[3], argv[4], argv[5], argv[6] ); @@ -505,15 +510,16 @@ *****************************************************************************/ void cmd_cif(int argc, char **argv) { - if ( argc != 2 ) { - printf("\rusage: cif <filename>\r\n"); + if ( argc != 3 ) { + printf("\rusage: cif <filename> <input>\r\n"); + printf("\rexampe: cif input_i_tra01.json i_tra01\n"); return; } char data_buf[1024]; snprintf(data_buf, sizeof(data_buf), "{ " - "\"id\": \"i_tra01\", " + "\"id\": \"%s\", " "\"name\": \"TRASAR\", " "\"units\": \"PPM\", " "\"min\": \"0\", " @@ -525,7 +531,7 @@ "\"size\": \"2\", " "\"order\": \"2\", " "\"rfreq\": \"5\", " - "\"fmt\": \"%%.2f\" } " + "\"fmt\": \"%%.2f\" } ", argv[2] ); bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024); @@ -953,12 +959,9 @@ char logString[128]; LogLocalApi_PopEntry( logString ); - if( logString[0] != '\0' ) - { + if( logString[0] != '\0' ) { printf("%s\r\n", logString ); - } - else - { + } else { printf("%s\r\n", "No String Found" ); } }