From b1c452cf1218241ce4464c3b280cbe8f72f33eb7 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 27 Nov 2016 06:47:06 +0100 Subject: Changed command line options * All lower case options define common options * All upper case options define network specific options --- src/amps/amps.c | 4 ++-- src/amps/amps.h | 2 +- src/amps/main.c | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/amps') diff --git a/src/amps/amps.c b/src/amps/amps.c index 3404441..d9f6287 100644 --- a/src/amps/amps.c +++ b/src/amps/amps.c @@ -356,7 +356,7 @@ static amps_t *search_pc(void) static void amps_go_idle(amps_t *amps); /* Create transceiver instance and link to a list. */ -int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback) +int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback) { sender_t *sender; amps_t *amps; @@ -422,7 +422,7 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev PDEBUG(DAMPS, DEBUG_DEBUG, "Creating 'AMPS' instance for channel = %d (sample rate %d).\n", channel, samplerate); /* init general part of transceiver */ - rc = sender_create(&s->sender, channel, sounddev, samplerate, cross_channels, rx_gain, 0, 0, write_wave, read_wave, loopback, 0, PILOT_SIGNAL_NONE); + rc = sender_create(&s->sender, channel, sounddev, samplerate, cross_channels, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, loopback, 0, PILOT_SIGNAL_NONE); if (rc < 0) { PDEBUG(DAMPS, DEBUG_ERROR, "Failed to init transceiver process!\n"); goto error; diff --git a/src/amps/amps.h b/src/amps/amps.h index 4c47f09..2a2686b 100644 --- a/src/amps/amps.h +++ b/src/amps/amps.h @@ -163,7 +163,7 @@ const char *amps_min12number(uint32_t min1); void amps_number2min(const char *number, uint32_t *min1, uint16_t *min2); const char *amps_min2number(uint32_t min1, uint16_t min2); const char *amps_scm(uint8_t scm); -int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback); +int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback); void amps_destroy(sender_t *sender); void amps_rx_signaling_tone(amps_t *amps, int tone, double quality); void amps_rx_sat(amps_t *amps, int tone, double quality); diff --git a/src/amps/main.c b/src/amps/main.c index a32fdc8..85c6523 100644 --- a/src/amps/main.c +++ b/src/amps/main.c @@ -47,9 +47,9 @@ int tolerant = 0; void print_help(const char *arg0) { - print_help_common(arg0, "-E -e -F yes | no "); + print_help_common(arg0, "-p -d -F yes | no "); /* - - */ - printf(" -t --channel-type | list\n"); + printf(" -T --channel-type | list\n"); printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0])); printf(" -F --flip-polarity no | yes\n"); printf(" Flip polarity of transmitted FSK signal. If yes, the sound card\n"); @@ -85,7 +85,7 @@ void print_help(const char *arg0) printf(" -S --sysinfo bis=0 | bis=1\n"); printf(" If 0, phone ignores BUSY/IDLE bit on FOCC (default = '%d')\n", bis); printf(" If 1, be sure to have a round-trip delay (latency) not more than 5 ms\n"); - printf(" -T --tolerant\n"); + printf(" -O --tolerant\n"); printf(" Be more tolerant when hunting for sync sequence\n"); printf("\nstation-id: Give 10 digit station-id, you don't need to enter it for every\n"); printf(" start of this program.\n"); @@ -98,15 +98,15 @@ static int handle_options(int argc, char **argv) int rc; static struct option long_options_special[] = { - {"channel-type", 1, 0, 't'}, + {"channel-type", 1, 0, 'T'}, {"flip-polarity", 1, 0, 'F'}, {"ms-power", 1, 0, 'P'}, {"sysinfo", 1, 0, 'S'}, - {"tolerant", 0, 0, 'T'}, + {"tolerant", 0, 0, 'O'}, {0, 0, 0, 0} }; - set_options_common("t:F:P:S:T", long_options_special); + set_options_common("T:F:P:S:O", long_options_special); while (1) { int option_index = 0, c; @@ -117,7 +117,7 @@ static int handle_options(int argc, char **argv) break; switch (c) { - case 't': + case 'T': if (!strcmp(optarg, "list")) { amps_channel_list(); exit(0); @@ -209,7 +209,7 @@ static int handle_options(int argc, char **argv) } skip_args += 2; break; - case 'T': + case 'O': tolerant = 1; skip_args += 1; break; @@ -326,7 +326,7 @@ int main(int argc, char *argv[]) if (!do_pre_emphasis || !do_de_emphasis) { fprintf(stderr, "*******************************************************************************\n"); - fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n"); + fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -p -d)!\n"); fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n"); fprintf(stderr, "Because carrier FSK signaling does not use emphasis, I like to control\n"); fprintf(stderr, "emphasis by myself for best results.\n"); @@ -347,7 +347,7 @@ int main(int argc, char *argv[]) amps_si si; init_sysinfo(&si, ms_power, ms_power, dcc, sid >> 1, regh, regr, pureg, pdreg, locaid, regincr, bis); - rc = amps_create(kanal[i], chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, &si, sid, scc, polarity, tolerant, loopback); + rc = amps_create(kanal[i], chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, &si, sid, scc, polarity, tolerant, loopback); if (rc < 0) { fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n"); goto fail; -- cgit v1.2.3