diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2016-03-02 19:47:40 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2016-05-08 16:11:13 +0200 |
commit | 021c34a899ec54563cfc9e88024a9ff88ee0c907 (patch) | |
tree | c78ce57c80ae4abf64cb23aad3aa2044638e8abf /src/anetz/main.c | |
parent | 57ba648ac4bad5d3f50249ecb0c24d0321282cb1 (diff) |
Add geo locations of A-Netz and B-Netz towers. (not exact location)
Diffstat (limited to 'src/anetz/main.c')
-rw-r--r-- | src/anetz/main.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/anetz/main.c b/src/anetz/main.c index 1276304..4e73f0a 100644 --- a/src/anetz/main.c +++ b/src/anetz/main.c @@ -33,6 +33,7 @@ #include "../common/besetztton.h" #include "anetz.h" #include "dsp.h" +#include "stations.h" #include "image.h" /* settings */ @@ -43,6 +44,10 @@ void print_help(const char *arg0) { print_help_common(arg0, ""); /* - - */ + printf(" -g --geo <lat>,<lon>\n"); + printf(" Give your coordinates of your location, to find closest base station.\n"); + printf(" (e.g. '--geo 51.186959,7.080194') Or use '--geo list' to get a list of\n"); + printf(" all base station locations.\n"); printf(" -P --page-sequence 0 | <ms>\n"); printf(" Cycle paging tones, rather than sending simultaniously.\n"); printf(" (default = '%d')\n", page_sequence); @@ -56,14 +61,16 @@ void print_help(const char *arg0) static int handle_options(int argc, char **argv) { int skip_args = 0; + char *p; static struct option long_options_special[] = { + {"geo", 1, 0, 'g'}, {"page-sequence", 1, 0, 'P'}, {"loss", 1, 0, '0'}, {0, 0, 0, 0} }; - set_options_common("P:0:", long_options_special); + set_options_common("g:P:0:", long_options_special); while (1) { int option_index = 0, c; @@ -74,6 +81,18 @@ static int handle_options(int argc, char **argv) break; switch (c) { + case 'g': + if (!strcasecmp(optarg, "list")) { + station_list(); + exit(0); + } + if ((p = strchr(optarg, ','))) { + get_station_by_coordinates(atof(optarg), atof(p + 1)); + exit(0); + } + fprintf(stderr, "Invalid geo parameter\n"); + exit(0); + break; case 'P': page_sequence = atoi(optarg); skip_args += 2; |