aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/tx_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/tx_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/tx_timed_samples.cpp')
-rw-r--r--host/examples/tx_timed_samples.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp
index 863446682..799da37e0 100644
--- a/host/examples/tx_timed_samples.cpp
+++ b/host/examples/tx_timed_samples.cpp
@@ -33,7 +33,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
time_t seconds_in_future;
size_t total_num_samps;
size_t samps_per_packet;
- double tx_rate, freq;
+ double rate, freq;
float ampl;
//setup the program options
@@ -44,7 +44,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("secs", po::value<time_t>(&seconds_in_future)->default_value(3), "number of seconds in the future to transmit")
("nsamps", po::value<size_t>(&total_num_samps)->default_value(1000), "total number of samples to transmit")
("spp", po::value<size_t>(&samps_per_packet)->default_value(1000), "number of samples per packet")
- ("txrate", po::value<double>(&tx_rate)->default_value(100e6/16), "rate of outgoing samples")
+ ("rate", po::value<double>(&rate)->default_value(100e6/16), "rate of outgoing samples")
("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz")
("ampl", po::value<float>(&ampl)->default_value(float(0.3)), "amplitude of each sample")
("dilv", "specify to disable inner-loop verbose")
@@ -68,12 +68,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 TX Rate: %f Msps...") % (tx_rate/1e6) << std::endl;
- sdev->set_tx_rate(tx_rate);
- std::cout << boost::format("Actual TX Rate: %f Msps...") % (sdev->get_tx_rate()/1e6) << std::endl;
- std::cout << boost::format("Setting device timestamp to 0...") << std::endl;
+ //set the tx sample rate
+ std::cout << boost::format("Setting TX Rate: %f Msps...") % (rate/1e6) << std::endl;
+ sdev->set_tx_rate(rate);
+ std::cout << boost::format("Actual TX Rate: %f Msps...") % (sdev->get_tx_rate()/1e6) << std::endl << std::endl;
+
+ //set the tx center frequency
+ std::cout << boost::format("Setting TX Freq: %f Mhz...") % (freq/1e6) << std::endl;
sdev->set_tx_freq(freq);
+ std::cout << boost::format("Actual TX Freq: %f Mhz...") % (sdev->get_tx_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));
//allocate data to send