summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-01-10 18:21:39 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-01-10 18:21:39 (GMT)
commite9d4ec7889417822c777ef3adaf0c6b9ddb07975 (patch)
tree6852ae4a2fefbf7d45324bdf2be19cbe6cd11328 /options.c
parent5b5a0e9950fa7e191a67cacabe55f1780fed5b5e (diff)
blinking led on heartbeat data works now
Diffstat (limited to 'options.c')
-rw-r--r--options.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/options.c b/options.c
index 8723981..3200d65 100644
--- a/options.c
+++ b/options.c
@@ -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
}