Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
124:48119db89152
Parent:
122:4db48b933115
Parent:
123:ce602c91a9c3
Child:
131:a290a3934132
--- a/src/CommandParser/cmd.cpp	Fri Sep 23 15:13:04 2016 +0000
+++ b/src/CommandParser/cmd.cpp	Fri Sep 23 15:29:15 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"
@@ -86,6 +87,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}
@@ -1024,7 +1026,7 @@
     UNUSED(argc);
     UNUSED(argv);
 
-    char logString[128];
+    char logString[LOG_BYTES_PER_ENTRY];
 
     LogLocalApi_PopEntry( logString );
     if( logString[0] != '\0' ) {
@@ -1042,4 +1044,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