diff options
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -196,6 +196,7 @@ int options_parse(options_t* opt, int argc, char* argv[]) #ifdef OPT_HEARTBEATCLIENT PARSE_STRING_PARAM("-d","--device", opt->serial_dev_) PARSE_INT_PARAM("-t","--timeout", opt->timeout_) + PARSE_STRING_PARAM("-l","--led", opt->led_filename_) #endif else return i; @@ -325,6 +326,7 @@ void options_default(options_t* opt) /* heartbeatclient only */ opt->timeout_ = 15; + opt->led_filename_ = NULL; } void options_clear(options_t* opt) @@ -362,6 +364,10 @@ void options_clear(options_t* opt) /* serialclient only */ if(opt->type_) free(opt->type_); + +/* heartbeatcleint only */ + if(opt->led_filename_) + free(opt->led_filename_); } void options_print_usage() @@ -406,6 +412,7 @@ void options_print_usage() #ifdef OPT_HEARTBEATCLIENT printf(" [-d|--device] <tty> the tty to connect to e.g. /dev/ttyUSB0\n"); printf(" [-t|--timeout] <timeout> heartbeat timeout in tenths of a second e.g. 15 -> 1.5s\n"); + printf(" [-l|--led] <led filename> sysfs filename of led device to blink\n"); #endif } @@ -460,5 +467,6 @@ void options_print(options_t* opt) #ifdef OPT_HEARTBEATCLIENT printf("serial_dev: '%s'\n", opt->serial_dev_); printf("timeout: %d\n", opt->timeout_); + printf("led_filename: '%s'\n", opt->led_filename_); #endif } |