aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/rx_timed_samples.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-28 18:23:27 -0700
committerJosh Blum <josh@joshknows.com>2010-10-28 18:23:27 -0700
commita8d2c2944b329218af1c0b171b92f775b679b409 (patch)
tree02e558d525055cb82e8d00a7a2d75fe324015ae6 /host/examples/rx_timed_samples.cpp
parentef8ed898cbc6cb6cd1994d2a8b090112f4f3a664 (diff)
parent6a3e499f586513d48ef648aa910e252b7d8b046b (diff)
downloaduhd-a8d2c2944b329218af1c0b171b92f775b679b409.tar.gz
uhd-a8d2c2944b329218af1c0b171b92f775b679b409.tar.bz2
uhd-a8d2c2944b329218af1c0b171b92f775b679b409.zip
Merge branch 'next'
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