1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-29 12:58:06 +02:00

tools/atrf-txrx/atrf-txrx.c (main): sort options alphabetically

This commit is contained in:
Werner Almesberger 2013-02-12 16:47:41 -03:00
parent 8710be5665
commit 49ca503cab

View File

@ -555,7 +555,7 @@ int main(int argc, char *const *argv)
const char *pcap_file = NULL; const char *pcap_file = NULL;
struct atrf_dsc *dsc; struct atrf_dsc *dsc;
while ((c = getopt(argc, argv, "c:C:d:f:Ho:p:r:E:Pt:T:")) != EOF) while ((c = getopt(argc, argv, "c:C:d:E:f:Ho:p:Pr:t:T:")) != EOF)
switch (c) { switch (c) {
case 'c': case 'c':
channel = strtoul(optarg, &end, 0); channel = strtoul(optarg, &end, 0);
@ -564,9 +564,22 @@ int main(int argc, char *const *argv)
if (channel < 11 || channel > 26) if (channel < 11 || channel > 26)
usage(*argv); usage(*argv);
break; break;
case 'C':
clkm = strtol(optarg, &end, 0);
if (*end)
usage(*argv);
if (!clkm)
usage(*argv);
break;
case 'd': case 'd':
driver = optarg; driver = optarg;
break; break;
case 'E':
set_mode(&mode, mode_per);
pause_s = strtof(optarg, &end);
if (*end)
usage(*argv);
break;
case 'f': case 'f':
freq = strtoul(optarg, &end, 0); freq = strtoul(optarg, &end, 0);
if (*end) if (*end)
@ -588,6 +601,9 @@ int main(int argc, char *const *argv)
if (*end) if (*end)
usage(*argv); usage(*argv);
break; break;
case 'P':
set_mode(&mode, mode_ping);
break;
case 'r': case 'r':
if (!strcmp(optarg, "250k")) if (!strcmp(optarg, "250k"))
rate = OQPSK_DATA_RATE_250; rate = OQPSK_DATA_RATE_250;
@ -607,22 +623,6 @@ int main(int argc, char *const *argv)
if (trim > 15) if (trim > 15)
usage(*argv); usage(*argv);
break; break;
case 'C':
clkm = strtol(optarg, &end, 0);
if (*end)
usage(*argv);
if (!clkm)
usage(*argv);
break;
case 'E':
set_mode(&mode, mode_per);
pause_s = strtof(optarg, &end);
if (*end)
usage(*argv);
break;
case 'P':
set_mode(&mode, mode_ping);
break;
case 'T': case 'T':
set_mode(&mode, mode_cont_tx); set_mode(&mode, mode_cont_tx);
if (!strcmp(optarg, "-2")) if (!strcmp(optarg, "-2"))