1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 18:08:06 +02:00

tools/atrf-txrx/atrf-txrx.c: option -q becomes "quick" and uses aggressive polling

This allows us to capture frames at full speed speed.
This commit is contained in:
Werner Almesberger 2013-07-30 20:00:45 -03:00
parent 07b1da29ec
commit 873f80cb4d

View File

@ -75,7 +75,7 @@ enum mode {
static volatile int run = 1; static volatile int run = 1;
static bool quiet = 0; static bool quick = 0;
/* ----- Helper functions -------------------------------------------------- */ /* ----- Helper functions -------------------------------------------------- */
@ -240,7 +240,8 @@ static void receive_pcap(struct atrf_dsc *dsc, const char *name)
while (run) { while (run) {
wait_for_interrupt(dsc, wait_for_interrupt(dsc,
IRQ_TRX_END, IRQ_TRX_END,
quiet ? 0xff : IRQ_TRX_END | IRQ_RX_START | IRQ_AMI, 0); quick ? 0xff : IRQ_TRX_END | IRQ_RX_START | IRQ_AMI,
quick ? -1 : 0);
if (!run) if (!run)
break; break;
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
@ -252,7 +253,7 @@ static void receive_pcap(struct atrf_dsc *dsc, const char *name)
continue; continue;
} }
write_pcap_rec(file, &now, buf, n-1); write_pcap_rec(file, &now, buf, n-1);
if (!quiet) if (!quick)
(void) write(2, ".", 1); (void) write(2, ".", 1);
count++; count++;
} }
@ -678,8 +679,8 @@ static void usage(const char *name)
" -f freq frequency in MHz, 2405 to 2480 (default %d)\n" " -f freq frequency in MHz, 2405 to 2480 (default %d)\n"
" -o file write received data to a file in pcap format\n" " -o file write received data to a file in pcap format\n"
" -p power transmit power, -17.2 to 3.0 dBm (default %.1f)\n" " -p power transmit power, -17.2 to 3.0 dBm (default %.1f)\n"
" -q quiet - suppress progress reports and warnings\n" " -q quick and quiet - suppress progress reports and warnings,\n"
" (currently only used when capturing)\n" " poll aggressively (currently only used when capturing)\n"
" -r rate data rate, 250k, 500k, 1M, or 2M (default: 250k)\n" " -r rate data rate, 250k, 500k, 1M, or 2M (default: 250k)\n"
" -t trim trim capacitor, 0 to 15 (default %d)\n" " -t trim trim capacitor, 0 to 15 (default %d)\n"
, name, name, name, name, name, name, , name, name, name, name, name, name,
@ -774,7 +775,7 @@ int main(int argc, char *const *argv)
set_mode(&mode, mode_ping); set_mode(&mode, mode_ping);
break; break;
case 'q': case 'q':
quiet = 1; quick = 1;
break; break;
case 'r': case 'r':
if (!strcmp(optarg, "250k")) if (!strcmp(optarg, "250k"))