aboutsummaryrefslogtreecommitdiffstats
path: root/src/bnetz
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-03-05 08:14:36 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2016-03-13 09:12:16 +0100
commitd21be383a6515760a38f403100a9d142633bf616 (patch)
tree099350c4f887644a0575c346cb8af583d1b93b35 /src/bnetz
parent9b8e3592643029412b38dbe5bfae4c73f0199a66 (diff)
anetz/bnetz: Move option 'loss detection' from common code to individual code
Diffstat (limited to 'src/bnetz')
-rw-r--r--src/bnetz/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bnetz/main.c b/src/bnetz/main.c
index 79b4d29..2d7fa53 100644
--- a/src/bnetz/main.c
+++ b/src/bnetz/main.c
@@ -36,6 +36,7 @@
int gfs = 2;
const char *pilot = "tone";
+double lossdetect = 0;
void print_help(const char *arg0)
{
@@ -53,6 +54,9 @@ void print_help(const char *arg0)
printf(" Example: /sys/class/gpio/gpio17/value=1:0 writes a '1' to\n");
printf(" /sys/class/gpio/gpio17/value to switching to channel 19 and a '0' to\n");
printf(" switch back. (default = %s)\n", pilot);
+ printf(" -0 --loss <volume>\n");
+ printf(" Detect loss of carrier by detecting steady noise above given volume in\n");
+ printf(" percent. (disabled by default)\n");
printf("\nstation-id: Give 5 digit station-id, you don't need to enter it for every\n");
printf(" start of this program.\n");
}
@@ -64,10 +68,11 @@ static int handle_options(int argc, char **argv)
static struct option long_options_special[] = {
{"gfs", 1, 0, 'g'},
{"pilot", 1, 0, 'P'},
+ {"loss", 1, 0, '0'},
{0, 0, 0, 0},
};
- set_options_common("g:P:", long_options_special);
+ set_options_common("g:P:0:", long_options_special);
while (1) {
int option_index = 0, c;
@@ -86,6 +91,10 @@ static int handle_options(int argc, char **argv)
pilot = strdup(optarg);
skip_args += 2;
break;
+ case '0':
+ lossdetect = atoi(optarg);
+ skip_args += 2;
+ break;
default:
opt_switch_common(c, argv[0], &skip_args);
}