Date:2013-07-30 18:48:55 (6 years 3 months ago)
Author:Werner Almesberger
Commit:d1b65cb058b3e32681811f76311ae09d6f12e1e7
Message:tools/atrf-txrx/atrf-txrx.c: new option -q for quiet capture

Files: tools/atrf-txrx/atrf-txrx.c (8 diffs)

Change Details

tools/atrf-txrx/atrf-txrx.c
1111 */
1212
1313
14#include <stdbool.h>
1415#include <stdint.h>
1516#include <stdlib.h>
1617#include <stdio.h>
...... 
7475
7576
7677static volatile int run = 1;
78static bool quiet = 0;
7779
7880
7981/* ----- Helper functions -------------------------------------------------- */
...... 
237239    write_pcap_hdr(file);
238240    while (run) {
239241        wait_for_interrupt(dsc,
240            IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START | IRQ_AMI, 0);
242            IRQ_TRX_END,
243            quiet ? 0xff : IRQ_TRX_END | IRQ_RX_START | IRQ_AMI, 0);
241244        if (!run)
242245            break;
243246        gettimeofday(&now, NULL);
...... 
249252            continue;
250253        }
251254        write_pcap_rec(file, &now, buf, n-1);
252        (void) write(2, ".", 1);
255        if (!quiet)
256            (void) write(2, ".", 1);
253257        count++;
254258    }
255259    if (fclose(file) == EOF) {
...... 
666670" command shell command to run while transmitting (default: wait for\n"
667671" SIGINT instead)\n\n"
668672" common options: [-c channel|-f freq] [-C mhz] [-d driver[:arg]] [-o file]\n"
669" [-p power] [-r rate] [-t trim]\n"
673" [-p power] [-q] [-r rate] [-t trim]\n"
670674" -c channel channel number, 11 to 26 (default %d)\n"
671675" -C mhz output clock at 1, 2, 4, 8, or 16 MHz (default: off)\n"
672676" -d driver[:arg]\n"
...... 
674678" -f freq frequency in MHz, 2405 to 2480 (default %d)\n"
675679" -o file write received data to a file in pcap format\n"
676680" -p power transmit power, -17.2 to 3.0 dBm (default %.1f)\n"
681" -q quiet - suppress progress reports and warnings\n"
682" (currently only used when capturing)\n"
677683" -r rate data rate, 250k, 500k, 1M, or 2M (default: 250k)\n"
678684" -t trim trim capacitor, 0 to 15 (default %d)\n"
679685        , name, name, name, name, name, name,
...... 
718724    const char *pcap_file = NULL;
719725    struct atrf_dsc *dsc;
720726
721    while ((c = getopt(argc, argv, "c:C:d:E:f:Ho:p:Pr:Rt:T:x")) != EOF)
727    while ((c = getopt(argc, argv, "c:C:d:E:f:Ho:p:Pqr:Rt:T:x")) != EOF)
722728        switch (c) {
723729        case 'c':
724730            channel = strtoul(optarg, &end, 0);
...... 
767773        case 'P':
768774            set_mode(&mode, mode_ping);
769775            break;
776        case 'q':
777            quiet = 1;
778            break;
770779        case 'r':
771780            if (!strcmp(optarg, "250k"))
772781                rate = OQPSK_DATA_RATE_250;

Archive Download the corresponding diff file



interactive