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

atrf-txrx: renamed BER (bit error rate) test to PER (packet ...) test

- atrf-txrx.c (usage, main): changed option -B to -P
- atrf-txrx.c (usage): "BER test mode" is now "PER test mode"
- atrf-txrx.c (main): mode_ber is now mode_per
This commit is contained in:
Werner Almesberger 2011-01-19 17:26:27 -03:00
parent ea81e70cf9
commit 96e8fc6dbf

View File

@ -455,8 +455,8 @@ static void usage(const char *name)
" text message mode:\n" " text message mode:\n"
" message message string to send (if absent, receive)\n" " message message string to send (if absent, receive)\n"
" repetitions number of times the message is sent (default 1)\n\n" " repetitions number of times the message is sent (default 1)\n\n"
" BER test mode (transmit only):\n" " PER test mode (transmit only):\n"
" -B pause_s seconds to pause between frames (floating-point)\n" " -P pause_s seconds to pause between frames (floating-point)\n"
" repetitions number of messages to send (default: infinite)\n\n" " repetitions number of messages to send (default: infinite)\n\n"
" constant wave test mode (transmit only):\n" " constant wave test mode (transmit only):\n"
" -T offset test mode. offset is the frequency offset of the constant\n" " -T offset test mode. offset is the frequency offset of the constant\n"
@ -481,7 +481,7 @@ int main(int argc, char *const *argv)
{ {
enum { enum {
mode_msg, mode_msg,
mode_ber, mode_per,
mode_cont_tx, mode_cont_tx,
} mode = mode_msg; } mode = mode_msg;
int channel = DEFAULT_CHANNEL; int channel = DEFAULT_CHANNEL;
@ -496,7 +496,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, "B:c:C:f:o:p:t:T:")) != EOF) while ((c = getopt(argc, argv, "c:C:f:o:p:P:t:T:")) != EOF)
switch (c) { switch (c) {
case 'c': case 'c':
channel = strtoul(optarg, &end, 0); channel = strtoul(optarg, &end, 0);
@ -530,12 +530,6 @@ int main(int argc, char *const *argv)
if (trim > 15) if (trim > 15)
usage(*argv); usage(*argv);
break; break;
case 'B':
mode = mode_ber;
pause_s = strtof(optarg, &end);
if (*end)
usage(*argv);
break;
case 'C': case 'C':
tmp = strtol(optarg, &end, 0); tmp = strtol(optarg, &end, 0);
if (*end) if (*end)
@ -547,6 +541,12 @@ int main(int argc, char *const *argv)
if (tmp != 1 || clkm > 5) if (tmp != 1 || clkm > 5)
usage(*argv); usage(*argv);
break; break;
case 'P':
mode = mode_per;
pause_s = strtof(optarg, &end);
if (*end)
usage(*argv);
break;
case 'T': case 'T':
mode = mode_cont_tx; mode = mode_cont_tx;
if (!strcmp(optarg, "-2")) if (!strcmp(optarg, "-2"))
@ -572,7 +572,7 @@ int main(int argc, char *const *argv)
case mode_msg: case mode_msg:
receive(dsc, pcap_file); receive(dsc, pcap_file);
break; break;
case mode_ber: case mode_per:
set_power(dsc, power, 0); set_power(dsc, power, 0);
transmit_pattern(dsc, pause_s, 0); transmit_pattern(dsc, pause_s, 0);
break; break;
@ -588,7 +588,7 @@ int main(int argc, char *const *argv)
switch (mode) { switch (mode) {
case mode_msg: case mode_msg:
break; break;
case mode_ber: case mode_per:
/* fall through */ /* fall through */
case mode_cont_tx: case mode_cont_tx:
usage(*argv); usage(*argv);
@ -607,7 +607,7 @@ int main(int argc, char *const *argv)
set_power(dsc, power, 1); set_power(dsc, power, 1);
transmit(dsc, argv[optind], times); transmit(dsc, argv[optind], times);
break; break;
case mode_ber: case mode_per:
times = strtoul(argv[optind+1], &end, 0); times = strtoul(argv[optind+1], &end, 0);
if (*end) if (*end)
usage(*argv); usage(*argv);