diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2016-11-27 06:47:06 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2016-11-27 22:06:47 +0100 |
commit | b1c452cf1218241ce4464c3b280cbe8f72f33eb7 (patch) | |
tree | 9ba2b9d504f52516a06c2532b34d12965788debc /src/anetz | |
parent | f911717aa47dd3528e99aa76de1d98c543eaa2cb (diff) |
Changed command line options
* All lower case options define common options
* All upper case options define network specific options
Diffstat (limited to 'src/anetz')
-rw-r--r-- | src/anetz/anetz.c | 4 | ||||
-rw-r--r-- | src/anetz/anetz.h | 2 | ||||
-rw-r--r-- | src/anetz/main.c | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c index c30d2ea..0d75990 100644 --- a/src/anetz/anetz.c +++ b/src/anetz/anetz.c @@ -137,7 +137,7 @@ static void anetz_timeout(struct timer *timer); static void anetz_go_idle(anetz_t *anetz); /* Create transceiver instance and link to a list. */ -int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_volume) +int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_volume) { anetz_t *anetz; int rc; @@ -156,7 +156,7 @@ int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_chan PDEBUG(DANETZ, DEBUG_DEBUG, "Creating 'A-Netz' instance for 'Kanal' = %d (sample rate %d).\n", kanal, samplerate); /* init general part of transceiver */ - rc = sender_create(&anetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_wave, read_wave, loopback, loss_volume, PILOT_SIGNAL_NONE); + rc = sender_create(&anetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, loss_volume, PILOT_SIGNAL_NONE); if (rc < 0) { PDEBUG(DANETZ, DEBUG_ERROR, "Failed to init 'Sender' processing!\n"); goto error; diff --git a/src/anetz/anetz.h b/src/anetz/anetz.h index a3fe5b8..be3984a 100644 --- a/src/anetz/anetz.h +++ b/src/anetz/anetz.h @@ -44,7 +44,7 @@ typedef struct anetz { double anetz_kanal2freq(int kanal, int unterband); int anetz_init(void); -int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_volume); +int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_volume); void anetz_destroy(sender_t *sender); void anetz_loss_indication(anetz_t *anetz); void anetz_receive_tone(anetz_t *anetz, int bit); diff --git a/src/anetz/main.c b/src/anetz/main.c index ce616cf..d4ea13f 100644 --- a/src/anetz/main.c +++ b/src/anetz/main.c @@ -42,14 +42,14 @@ void print_help(const char *arg0) { print_help_common(arg0, ""); /* - - */ - printf(" -g --geo <lat>,<lon>\n"); + 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); - printf(" -0 --loss <volume>\n"); + printf(" -L --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 (last) 5 digits of station-id, you don't need to enter it\n"); @@ -62,13 +62,13 @@ static int handle_options(int argc, char **argv) char *p; static struct option long_options_special[] = { - {"geo", 1, 0, 'g'}, + {"geo", 1, 0, 'G'}, {"page-sequence", 1, 0, 'P'}, - {"loss", 1, 0, '0'}, + {"loss", 1, 0, 'L'}, {0, 0, 0, 0} }; - set_options_common("g:P:0:", long_options_special); + set_options_common("G:P:L:", long_options_special); while (1) { int option_index = 0, c; @@ -79,7 +79,7 @@ static int handle_options(int argc, char **argv) break; switch (c) { - case 'g': + case 'G': if (!strcasecmp(optarg, "list")) { station_list(); exit(0); @@ -95,7 +95,7 @@ static int handle_options(int argc, char **argv) page_sequence = atoi(optarg); skip_args += 2; break; - case '0': + case 'L': lossdetect = atoi(optarg); skip_args += 2; break; @@ -167,7 +167,7 @@ int main(int argc, char *argv[]) /* create transceiver instance */ for (i = 0; i < num_kanal; i++) { - rc = anetz_create(kanal[i], sounddev[i], samplerate, cross_channels, rx_gain, page_sequence, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, loopback, lossdetect / 100.0); + rc = anetz_create(kanal[i], sounddev[i], samplerate, cross_channels, rx_gain, page_sequence, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, lossdetect / 100.0); if (rc < 0) { fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n"); goto fail; |