[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8633 - usrp2/branches/features/host-ng/host-ng/apps
From: |
eb |
Subject: |
[Commit-gnuradio] r8633 - usrp2/branches/features/host-ng/host-ng/apps |
Date: |
Thu, 19 Jun 2008 16:15:24 -0600 (MDT) |
Author: eb
Date: 2008-06-19 16:15:24 -0600 (Thu, 19 Jun 2008)
New Revision: 8633
Modified:
usrp2/branches/features/host-ng/host-ng/apps/test_usrp2.cc
Log:
Give me a clue when it exits
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
21:33:12 UTC (rev 8632)
+++ usrp2/branches/features/host-ng/host-ng/apps/test_usrp2.cc 2008-06-19
22:15:24 UTC (rev 8633)
@@ -52,6 +52,8 @@
const char *interface = "eth0";
const char *mac_addr_str = "";
double freq = 0.0;
+ double rx_gain = 0.0;
+ int decim = 5;
int ch;
@@ -87,23 +89,32 @@
usrp2::usrp2::sptr u2 = usrp2::usrp2::make(interface, mac_addr_str);
- if (!u2->set_rx_gain(1.0))
+ if (!u2->set_rx_gain(rx_gain)){
+ fprintf(stderr, "set_rx_gain(%f) failed\n", rx_gain);
exit(1);
+ }
usrp2::tune_result tr;
- if (!u2->set_rx_freq(freq, &tr))
+ if (!u2->set_rx_freq(freq, &tr)){
+ fprintf(stderr, "set_rx_freq(%g) failed\n", freq);
exit(1);
+ }
printf("baseband_freq=%f\n", tr.baseband_freq);
printf(" ddc_freq=%f\n", tr.dxc_freq);
printf("residual_freq=%f\n", tr.residual_freq);
printf(" inverted=%s\n", tr.spectrum_inverted ? "yes" : "no");
- if (!u2->set_rx_decim(5))
+ if (!u2->set_rx_decim(decim)){
+ fprintf(stderr, "set_rx_decim(%d) failed\n", decim);
exit(1);
+ }
- if (!u2->start_rx_streaming())
- exit(1);;
+ if (!u2->start_rx_streaming()){
+ fprintf(stderr, "start_rx_streaming failed\n");
+ exit(1);
+ }
+
struct timespec ts;
ts.tv_sec = 4;
@@ -115,6 +126,7 @@
u2->stop_rx_streaming();
ts.tv_sec = 1;
+ ts.tv_nsec = 0;
r = nanosleep(&ts, 0);
if (r == -1)
perror("nanosleep");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8633 - usrp2/branches/features/host-ng/host-ng/apps,
eb <=