From 9eb0233d94d05b89d8dab1ad192f5010d1282341 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Mon, 3 Feb 2020 14:39:58 -0600 Subject: Changed getopt path option to conform with other utilities --- util_tx_continuous/src/util_tx_continuous.c | 54 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'util_tx_continuous') diff --git a/util_tx_continuous/src/util_tx_continuous.c b/util_tx_continuous/src/util_tx_continuous.c index 6cf2999..aeaae8d 100644 --- a/util_tx_continuous/src/util_tx_continuous.c +++ b/util_tx_continuous/src/util_tx_continuous.c @@ -293,35 +293,35 @@ int main(int argc, char **argv) } break; - case 'f': - i = sscanf(optarg, "%f", &arg_f); - if ((i != 1) || (arg_f < 1)) { - printf("ERROR: argument parsing of -f argument. Use -h to print help\n"); - return EXIT_FAILURE; - } - else { - freq_hz = (uint32_t)((arg_f * 1e6) + 0.5); - } - break; - - case 'r': - i = sscanf(optarg, "%u", &arg_u); - switch (arg_u) { - case 1255: - radio_type = LGW_RADIO_TYPE_SX1255; - break; - case 1257: - radio_type = LGW_RADIO_TYPE_SX1257; - break; - default: - printf("ERROR: argument parsing of -r argument. Use -h to print help\n"); + case 'f': + i = sscanf(optarg, "%f", &arg_f); + if ((i != 1) || (arg_f < 1)) { + printf("ERROR: argument parsing of -f argument. Use -h to print help\n"); return EXIT_FAILURE; - } - break; + } + else { + freq_hz = (uint32_t)((arg_f * 1e6) + 0.5); + } + break; - default: - printf("ERROR: argument parsing options. Use -h to print help\n"); - return EXIT_FAILURE; + case 'r': + i = sscanf(optarg, "%u", &arg_u); + switch (arg_u) { + case 1255: + radio_type = LGW_RADIO_TYPE_SX1255; + break; + case 1257: + radio_type = LGW_RADIO_TYPE_SX1257; + break; + default: + printf("ERROR: argument parsing of -r argument. Use -h to print help\n"); + return EXIT_FAILURE; + } + break; + + default: + printf("ERROR: argument parsing options. Use -h to print help\n"); + return EXIT_FAILURE; } } -- cgit v1.2.3