Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
87:c466bde76fa0
Parent:
82:f3e495a98877
Parent:
86:189c125d8878
Child:
88:8a1a2bba8850
--- a/src/CommandParser/cmd.cpp	Tue Sep 20 15:35:13 2016 +0000
+++ b/src/CommandParser/cmd.cpp	Tue Sep 20 16:02:58 2016 +0000
@@ -55,7 +55,7 @@
 const command_table_t cmdlist[] = {
     {"?",                   "help command",                                     cmd_help            },
     {"create-control",      "create a control",                                 cmd_create          },
-    {"destroy",             "destroy a control",                                cmd_destroy         },
+    {"destroy-control",     "destroy a control",                                cmd_destroy         },
     {"ccf",                 "create a test control file",                       cmd_ccf             },
     {"cif",                 "create a test input file",                         cmd_cif             },
     {"cof",                 "create a test output file",                        cmd_cof             },
@@ -63,14 +63,14 @@
     {"help",                "help command",                                     cmd_help            },
     {"log-level",           "get/set mDot log level",                           cmd_logLevel        },
     {"ls",                  "list user files",                                  cmd_ls              },
-    {"modify",              "modify a control",                                 cmd_modify          },
+    {"modify-control",      "modify a control",                                 cmd_modify          },
     {"modmap",              "dump modbus register map",                         cmd_modmap          },
     {"reset",               "reset the controller",                             cmd_reset           },
     {"reset-stats",         "reset current mDot statistics",                    cmd_resetStats      },
     {"rm",                  "remove a user file",                               cmd_rm              },
     {"rssi-stats",          "get current rssi stats",                           cmd_rssiStats       },
     {"show-controls",       "display active controls",                          cmd_ShowControls    },
-    {"show-outputs",             "dump outputs",                                cmd_outputs         },
+    {"show-outputs",        "dump outputs",                                     cmd_outputs         },
     {"snr-stats",           "get current SNR stats",                            cmd_snrStats        },
     {"stack",               "get thread stack usage stats",                     cmd_stack           },
     {"stats",               "get current mDot statistics",                      cmd_stats           },
@@ -370,25 +370,27 @@
  *****************************************************************************/
 void cmd_ccf(int argc, char **argv)
 {
-    if ( argc != 2 ) {
-        printf("\rusage: ccf <filename>\r\n");
+    if ( argc != 5 ) {
+        printf("\rusage: ccf <filename> <id> <input> <output>\n");
+        printf("\rexample: ccf control_sp_1.json SPC_01 i_tra03 o_rly1\n");
         return;
     }
 
     char data_buf[1024];
     snprintf(data_buf, sizeof(data_buf),
              "{ "
-             "\"id\":       \"SP\", "
+             "\"id\":       \"%s\", "
              "\"name\":     \"TRASAR\", "
              "\"priority\": \"800\", "
-             "\"input\":    \"i_tra01\", "
-             "\"output\":   \"o_r05\", "
+             "\"input\":    \"%s\", "
+             "\"output\":   \"%s\", "
              "\"prodfact\": \"100\", "
+             "\"setpoint\": \"100\", "
              "\"halert\":   \"115\", "
              "\"lalert\":   \"85\", "
              "\"hfs\":      \"130\", "
              "\"lfs\":      \"70\", "
-             "\"tol\":      \"5\" } "
+             "\"tol\":      \"5\" } ", argv[2], argv[3], argv[4]
             );
 
     bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024);