aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/rx_timed_samples.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-27 19:18:26 -0700
committerJosh Blum <josh@joshknows.com>2010-10-27 19:18:26 -0700
commitdc9f22c9a7989e4485d6f03b0ccf6ea19e6ae42d (patch)
tree64f9ca99eebf09a5dafe15fe957c5a29b2526ceb /host/examples/rx_timed_samples.cpp
parentf820cce9be9bcea9723cf7b4e85a4ded2f1d2c62 (diff)
downloaduhd-dc9f22c9a7989e4485d6f03b0ccf6ea19e6ae42d.tar.gz
uhd-dc9f22c9a7989e4485d6f03b0ccf6ea19e6ae42d.tar.bz2
uhd-dc9f22c9a7989e4485d6f03b0ccf6ea19e6ae42d.zip
uhd: added rx samples to udp example, cleaned up other examples, added gain options
Diffstat (limited to 'host/examples/rx_timed_samples.cpp')
-rw-r--r--host/examples/rx_timed_samples.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp
index 441665900..8a810811f 100644
--- a/host/examples/rx_timed_samples.cpp
+++ b/host/examples/rx_timed_samples.cpp
@@ -32,7 +32,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::string args;
time_t seconds_in_future;
size_t total_num_samps;
- double rx_rate, freq;
+ double rate, freq;
//setup the program options
po::options_description desc("Allowed options");
@@ -41,7 +41,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("secs", po::value<time_t>(&seconds_in_future)->default_value(3), "number of seconds in the future to receive")
("nsamps", po::value<size_t>(&total_num_samps)->default_value(1000), "total number of samples to receive")
- ("rxrate", po::value<double>(&rx_rate)->default_value(100e6/16), "rate of incoming samples")
+ ("rate", po::value<double>(&rate)->default_value(100e6/16), "rate of incoming samples")
("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz")
("dilv", "specify to disable inner-loop verbose")
;
@@ -64,12 +64,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
uhd::device::sptr dev = sdev->get_device();
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
- //set properties on the device
- std::cout << boost::format("Setting RX Rate: %f Msps...") % (rx_rate/1e6) << std::endl;
- sdev->set_rx_rate(rx_rate);
- std::cout << boost::format("Actual RX Rate: %f Msps...") % (sdev->get_rx_rate()/1e6) << std::endl;
- std::cout << boost::format("Setting device timestamp to 0...") << std::endl;
+ //set the rx sample rate
+ std::cout << boost::format("Setting RX Rate: %f Msps...") % (rate/1e6) << std::endl;
+ sdev->set_rx_rate(rate);
+ std::cout << boost::format("Actual RX Rate: %f Msps...") % (sdev->get_rx_rate()/1e6) << std::endl << std::endl;
+
+ //set the rx center frequency
+ std::cout << boost::format("Setting RX Freq: %f Mhz...") % (freq/1e6) << std::endl;
sdev->set_rx_freq(freq);
+ std::cout << boost::format("Actual RX Freq: %f Mhz...") % (sdev->get_rx_freq()/1e6) << std::endl << std::endl;
+
+ std::cout << boost::format("Setting device timestamp to 0...") << std::endl;
sdev->set_time_now(uhd::time_spec_t(0.0));
//setup streaming