Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
117:a4a61da3de36
Parent:
113:001ad47df8ec
Parent:
116:7337ed514891
Child:
118:2a131efdfd5a
--- a/src/CommandParser/cmd.cpp	Thu Sep 22 19:38:03 2016 +0000
+++ b/src/CommandParser/cmd.cpp	Thu Sep 22 21:11:20 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}
@@ -417,8 +420,13 @@
              "\"halert\":       \"115\","
              "\"lalert\":       \"85\", "
              "\"hfs\":          \"130\","
+<<<<<<< local
              "\"lfs\":          \"70\", " 
              "\"tol\":          \"%s\"  }", argv[2], argv[3], argv[4], argv[5], argv[6]
+=======
+             "\"lfs\":          \"70\", "
+             "\"tol\":          \"%s\"  ", argv[2], argv[3], argv[4], argv[5], argv[6]
+>>>>>>> other
             );
 
     bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024);
@@ -426,8 +434,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;
@@ -476,8 +484,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;
@@ -562,8 +570,13 @@
              "\"duration\":     \"30\", "       // seconds
              "\"setpoint\":     \"2000.0\", "
              "\"state\":        \"1\", "
+<<<<<<< local
              "\"percent\":      \"100\", }", argv[2]
              
+=======
+             "\"percent\":      \"100\", ", argv[2]
+
+>>>>>>> other
             );
 
     bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024);
@@ -881,7 +894,7 @@
         printf("\rusage: sout <output> <value>\r\n");
         printf("\rexample: sout o_rly1 1\r\n");
         return;
-    }    
+    }
     ModbusMasterWriteRegister( argv[1], value );
 }
 
@@ -895,13 +908,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
@@ -929,7 +942,7 @@
     }
 
     SimulateInputMap[argv[1]].start_value = atof(argv[2]);
-    
+
     ModbusRegisterMap[argv[1]].simulated = true;
 
     if ( argc < 3 ) {
@@ -941,4 +954,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