From 39bfc25fc3815d7011ebe434bd03b073f010de74 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 26 May 2011 16:50:31 -0700 Subject: add gain to tx burst app --- host/examples/tx_bursts.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/examples') diff --git a/host/examples/tx_bursts.cpp b/host/examples/tx_bursts.cpp index 0545a8870..e5d1ec73e 100644 --- a/host/examples/tx_bursts.cpp +++ b/host/examples/tx_bursts.cpp @@ -41,6 +41,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ float ampl; double freq; double rep_rate; + double gain; //setup the program options po::options_description desc("Allowed options"); @@ -53,6 +54,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("rate", po::value(&rate)->default_value(100e6/16), "rate of outgoing samples") ("ampl", po::value(&l)->default_value(float(0.3)), "amplitude of each sample") ("freq", po::value(&freq)->default_value(0), "center frequency") + ("gain", po::value(&gain)->default_value(0), "gain") ("dilv", "specify to disable inner-loop verbose") ; po::variables_map vm; @@ -82,6 +84,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ for(size_t i=0; i < usrp->get_tx_num_channels(); i++) usrp->set_tx_freq(freq, i); std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq()/1e6) << std::endl << std::endl; + std::cout << boost::format("Setting TX Gain: %f...") % (gain) << std::endl; + for(size_t i=0; i < usrp->get_tx_num_channels(); i++) usrp->set_tx_gain(gain, i); + std::cout << boost::format("Actual TX Gain: %f...") % (usrp->get_tx_gain()) << std::endl << std::endl; + std::cout << boost::format("Setting device timestamp to 0...") << std::endl; usrp->set_time_now(uhd::time_spec_t(0.0)); -- cgit v1.2.3