Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
62:1b1d7918adf2
Parent:
54:ec1b03064bbd
Child:
63:0ded43237b22
--- a/src/CommandParser/cmd.cpp	Wed Sep 14 22:26:43 2016 +0000
+++ b/src/CommandParser/cmd.cpp	Thu Sep 15 16:17:08 2016 +0000
@@ -37,6 +37,7 @@
 #include "ConfigurationHandler.h"
 #include "mDot.h"
 #include "rtos.h"
+#include "rtc.h"
 
 Serial serial(USBTX, USBRX);
 ntshell_t ntshell;
@@ -70,6 +71,7 @@
     {"snr-stats",           "get current SNR stats",                            cmd_snrStats        },
     {"stack",               "get thread stack usage stats",                     cmd_stack           },
     {"stats",               "get current mDot statistics",                      cmd_stats           },
+    {"time",                "get current time",                                 cmd_time            },
     {NULL, NULL, NULL}
 };
 
@@ -649,3 +651,21 @@
 
     printf("\r\n");
 }
+
+/*****************************************************************************
+ * Function:        cmd_time
+ * Description:     display real-time clock 
+ *
+ * @param           argc (not used)
+ * @param           argv (not used)
+ * @return          none
+ *****************************************************************************/
+void cmd_time(int argc, char **argv)
+{
+    UNUSED(argc);
+    UNUSED(argv);
+
+    int iyr=0, imo=0, idy=0, ihr=0, imn=0, isc=0;
+    rtc_get_time(&iyr, &imo, &idy, &ihr, &imn, &isc);
+    printf("%04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc);
+}
\ No newline at end of file