Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
123:ce602c91a9c3
Parent:
118:2a131efdfd5a
Child:
124:48119db89152
--- a/src/CommandParser/cmd.cpp	Thu Sep 22 21:30:48 2016 +0000
+++ b/src/CommandParser/cmd.cpp	Fri Sep 23 15:25:06 2016 +0000
@@ -37,6 +37,7 @@
 #include "ConfigurationHandler.h"
 #include "ModbusMasterApi.h"
 #include "LogLocalApi.h"
+#include "LoggerApi.h"
 #include "OutputTask.h"
 #include "mDot.h"
 #include "rtos.h"
@@ -85,6 +86,7 @@
     {"simin",               "simulate input",                                   cmd_simin           },
     {"deep",                "dump EEP",                                         cmd_deep            },
     {"peep",                "push EEP",                                         cmd_peep            },
+    {"ins-log",             "insert log event",                                 cmd_inslog          },
 
 
     {NULL, NULL, NULL}
@@ -420,7 +422,7 @@
              "\"halert\":       \"115\","
              "\"lalert\":       \"85\", "
              "\"hfs\":          \"130\","
-             "\"lfs\":          \"70\", " 
+             "\"lfs\":          \"70\", "
              "\"tol\":          \"%s\"  }", argv[2], argv[3], argv[4], argv[5], argv[6]
             );
 
@@ -950,15 +952,12 @@
     UNUSED(argc);
     UNUSED(argv);
 
-    char logString[128];
+    char logString[LOG_BYTES_PER_ENTRY];
 
     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" );
     }
 }
@@ -971,4 +970,18 @@
     std::string logString = "This is a string to log";
 
     LogLocalApi_PushEntry( logString.c_str() );
+}
+
+void cmd_inslog( int argc, char **argv )
+{
+    UNUSED(argc);
+    UNUSED(argv);
+
+    EventReasonStruct_t eventReason;
+    eventReason.eventReason = EVENT_REASON_AUTO;
+    eventReason.inputValue = 100.00;
+    strncpy(eventReason.inputTag, "i_stub01", sizeof(eventReason.inputTag) );
+    eventReason.outputValue = 0.0;
+    strncpy(eventReason.outputTag, "o_stub01", sizeof(eventReason.outputTag) );
+    EventLoggerApi( eventReason );
 }
\ No newline at end of file