Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
133:c871de2d2b90
Parent:
132:45821e189dd0
Child:
148:ee3cbaafe355
Child:
152:c03ebcda54ef
--- a/src/CommandParser/cmd.cpp	Tue Sep 27 12:18:47 2016 +0000
+++ b/src/CommandParser/cmd.cpp	Tue Sep 27 15:28:59 2016 +0000
@@ -463,9 +463,9 @@
  *****************************************************************************/
 void cmd_createTimer(int argc, char **argv)
 {
-    if ( argc != 7 ) {
-        printf("\rusage: create-timer <filename> <id> <output> <priority> <startTime> <duration>\n");
-        printf("\rexample: create-timer control_tm_1.json timer-1 o_rly1 750 1474918598 60\n");
+    if ( argc != 6 ) {
+        printf("\rusage: create-timer <filename> <id> <output> <priority> <duration>\n");
+        printf("\rexample: create-timer control_tm_1.json timer-1 o_rly1 750 60\n");
         printf("\r     <startTime> is epoch time\n");
         printf("\r     <duration>  is in seconds\r\n");
         return;
@@ -475,6 +475,9 @@
         printf("\rFilename must be prefixed with control_tm_*\n");
         return;
     }
+    
+    char time_buf[32];
+    sprintf(time_buf, "%lu", time(NULL)+5);
 
     char data_buf[1024];
     snprintf(data_buf, sizeof(data_buf),
@@ -483,7 +486,7 @@
              "\"output\":       \"%s\", "
              "\"priority\":     \"%s\", "
              "\"starttime\":    \"%s\", "
-             "\"duration\":     \"%s\", ", argv[2], argv[3], argv[4], argv[5], argv[6]
+             "\"duration\":     \"%s\", ", argv[2], argv[3], argv[4], time_buf, argv[5]
              );