[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8635 - usrp2/branches/features/host-ng/host-ng/apps
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r8635 - usrp2/branches/features/host-ng/host-ng/apps |
Date: |
Thu, 19 Jun 2008 16:25:13 -0600 (MDT) |
Author: jcorgan
Date: 2008-06-19 16:25:05 -0600 (Thu, 19 Jun 2008)
New Revision: 8635
Modified:
usrp2/branches/features/host-ng/host-ng/apps/test_usrp2.cc
Log:
work-in-progress, fix conflict with prior check-in
Modified: usrp2/branches/features/host-ng/host-ng/apps/test_usrp2.cc
===================================================================
--- usrp2/branches/features/host-ng/host-ng/apps/test_usrp2.cc 2008-06-19
22:15:46 UTC (rev 8634)
+++ usrp2/branches/features/host-ng/host-ng/apps/test_usrp2.cc 2008-06-19
22:25:05 UTC (rev 8635)
@@ -43,6 +43,7 @@
fprintf(stderr, " -e ETH_INTERFACE specify ethernet interface
[default=eth0]\n");
fprintf(stderr, " -m MAC_ADDR mac address of USRP2 HH:HH
[default=first one found]\n");
fprintf(stderr, " -f FREQUENCY specify receive center frequency in
Hz [default=0.0]\n");
+ fprintf(stderr, " -d DECIM specify receive decimation rate
(4-512) [default=5]\n");
}
int
@@ -52,12 +53,12 @@
const char *interface = "eth0";
const char *mac_addr_str = "";
double freq = 0.0;
+ int rx_decim = 5;
double rx_gain = 0.0;
- int decim = 5;
int ch;
- while ((ch = getopt(argc, argv, "he:m:f:")) != EOF){
+ while ((ch = getopt(argc, argv, "he:m:f:d:")) != EOF){
switch (ch){
case 'e':
@@ -76,6 +77,15 @@
}
break;
+ case 'd':
+ rx_decim = strtol(optarg, 0, 0);
+ if (rx_decim < 4 or rx_decim > 512) { // FIXME: check stride
+ std::cerr << "invalid decimation rate: " << optarg << std::endl;
+ usage(argv[0]);
+ exit(1);
+ }
+ break;
+
case 'h':
default:
usage(argv[0]);
@@ -105,8 +115,8 @@
printf("residual_freq=%f\n", tr.residual_freq);
printf(" inverted=%s\n", tr.spectrum_inverted ? "yes" : "no");
- if (!u2->set_rx_decim(decim)){
- fprintf(stderr, "set_rx_decim(%d) failed\n", decim);
+ if (!u2->set_rx_decim(rx_decim)) {
+ fprintf(stderr, "set_rx_decim(%d) failed\n", rx_decim);
exit(1);
}
@@ -115,7 +125,6 @@
exit(1);
}
-
struct timespec ts;
ts.tv_sec = 4;
ts.tv_nsec = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8635 - usrp2/branches/features/host-ng/host-ng/apps,
jcorgan <=