aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Kozel <derek.kozel@ettus.com>2016-08-01 16:56:59 -0700
committerMartin Braun <martin.braun@ettus.com>2016-08-03 12:10:03 -0700
commitac93ba035daf9eb8cf7b213eda086aa40f2a572d (patch)
treee4cb25bc8a8d7746d2cd7b5bc550f22fd28f2811
parent7dd34d09d96652a5040e14dae43b150ba302f740 (diff)
downloaduhd-ac93ba035daf9eb8cf7b213eda086aa40f2a572d.tar.gz
uhd-ac93ba035daf9eb8cf7b213eda086aa40f2a572d.tar.bz2
uhd-ac93ba035daf9eb8cf7b213eda086aa40f2a572d.zip
examples: Added tx and rx subdev arguments to benchmark_rate
-rw-r--r--host/examples/benchmark_rate.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp
index aef4a7c25..f24d8fde6 100644
--- a/host/examples/benchmark_rate.cpp
+++ b/host/examples/benchmark_rate.cpp
@@ -262,6 +262,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args;
+ std::string rx_subdev, tx_subdev;
double duration;
double rx_rate, tx_rate;
std::string rx_otw, tx_otw;
@@ -277,6 +278,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("help", "help message")
("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("duration", po::value<double>(&duration)->default_value(10.0), "duration for the test in seconds")
+ ("rx_subdev", po::value<std::string>(&rx_subdev)->default_value(""), "specify the device subdev for RX")
+ ("tx_subdev", po::value<std::string>(&tx_subdev)->default_value(""), "specify the device subdev for TX")
("rx_rate", po::value<double>(&rx_rate), "specify to perform a RX rate test (sps)")
("tx_rate", po::value<double>(&tx_rate), "specify to perform a TX rate test (sps)")
("rx_otw", po::value<std::string>(&rx_otw)->default_value("sc16"), "specify the over-the-wire sample mode for RX")
@@ -329,6 +332,15 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
+
+ //always select the subdevice first, the channel mapping affects the other settings
+ if (vm.count("rx_subdev")) {
+ usrp->set_rx_subdev_spec(rx_subdev);
+ }
+ if (vm.count("tx_subdev")) {
+ usrp->set_tx_subdev_spec(tx_subdev);
+ }
+
std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl;
int num_mboards = usrp->get_num_mboards();