Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/CommandParser/cmd.cpp
- Revision:
- 132:45821e189dd0
- Parent:
- 131:a290a3934132
- Child:
- 133:c871de2d2b90
--- a/src/CommandParser/cmd.cpp Mon Sep 26 17:36:30 2016 +0000 +++ b/src/CommandParser/cmd.cpp Tue Sep 27 12:18:47 2016 +0000 @@ -463,19 +463,11 @@ *****************************************************************************/ void cmd_createTimer(int argc, char **argv) { - if ( argc != 9 ) { - printf("\rusage: create-timer <filename> <id> <dow> <startw> <output> " - "<startHour> <startMinute> <duration>\n"); - printf("\rexample: create-timer control_tm_1.json timer-1 42 1 o_rly01 " - "12 00 60\n"); - printf("\r dow is the integer value of or'd bits for each day\n"); - printf("\r 1 = Sunday\n"); - printf("\r 2 = Monday\n"); - printf("\r 4 = Tuesday\n"); - printf("\r 8 = Wednesday\n"); - printf("\r 16 = Thursday\n"); - printf("\r 32 = Friday\n"); - printf("\r 64 = Saturday\n"); + 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"); + printf("\r <startTime> is epoch time\n"); + printf("\r <duration> is in seconds\r\n"); return; } @@ -488,15 +480,12 @@ snprintf(data_buf, sizeof(data_buf), "{ " "\"id\": \"%s\", " - "\"priority\": \"800\"," - "\"dow\": \"%s\", " - "\"startw\": \"%s\", " "\"output\": \"%s\", " - "\"startHour\": \"%s\", " - "\"startMinute\": \"%s\", " - "\"duration\": \"%s\", }", - argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8] - ); + "\"priority\": \"%s\", " + "\"starttime\": \"%s\", " + "\"duration\": \"%s\", ", argv[2], argv[3], argv[4], argv[5], argv[6] + ); + bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024); if( status != true ) { @@ -932,16 +921,7 @@ int iyr=0, imo=0, idy=0, ihr=0, imn=0, isc=0; rtc_get_time(&iyr, &imo, &idy, &ihr, &imn, &isc); printf("RTC time: %04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc); - - struct tm *time_info; - time_info = localtime(&rawtime); - printf("Local time: %04d-%02d-%02d %02d:%02d:%02d\r\n", - time_info->tm_year + 1900, - time_info->tm_mon + 1, // 0 = Jan, 11 = Dec - time_info->tm_mday, - time_info->tm_hour, - time_info->tm_min, - time_info->tm_sec); + printf("\repoch timestamp: %lu\r\n", time(NULL)); } /*****************************************************************************