diff options
author | Josh Blum <josh@joshknows.com> | 2010-10-27 19:18:26 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-10-27 19:18:26 -0700 |
commit | dc9f22c9a7989e4485d6f03b0ccf6ea19e6ae42d (patch) | |
tree | 64f9ca99eebf09a5dafe15fe957c5a29b2526ceb /host/examples/tx_timed_samples.cpp | |
parent | f820cce9be9bcea9723cf7b4e85a4ded2f1d2c62 (diff) | |
download | uhd-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/tx_timed_samples.cpp')
-rw-r--r-- | host/examples/tx_timed_samples.cpp | 19 |
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>(&l)->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 |