aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorNick Foster <nick@ettus.com>2011-05-26 16:50:31 -0700
committerNick Foster <nick@ettus.com>2011-05-26 16:50:31 -0700
commit39bfc25fc3815d7011ebe434bd03b073f010de74 (patch)
treef20592221e8dd2e92f9bb8be3c5852c705c4c6e6 /host/examples
parent202ae92825e8c0d406cf0efc800f2abb731ad358 (diff)
downloaduhd-39bfc25fc3815d7011ebe434bd03b073f010de74.tar.gz
uhd-39bfc25fc3815d7011ebe434bd03b073f010de74.tar.bz2
uhd-39bfc25fc3815d7011ebe434bd03b073f010de74.zip
add gain to tx burst app
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/tx_bursts.cpp6
1 files changed, 6 insertions, 0 deletions
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<double>(&rate)->default_value(100e6/16), "rate of outgoing samples")
("ampl", po::value<float>(&ampl)->default_value(float(0.3)), "amplitude of each sample")
("freq", po::value<double>(&freq)->default_value(0), "center frequency")
+ ("gain", po::value<double>(&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));