aboutsummaryrefslogtreecommitdiffstats
path: root/tools/kitchen_sink/kitchen_sink.cpp
diff options
context:
space:
mode:
authorBalint Seeber <balint@ettus.com>2014-10-10 15:48:32 -0700
committerMartin Braun <martin.braun@ettus.com>2014-10-13 08:50:54 +0200
commit513224c7f02d4639201b2d93eed12a3799604e6e (patch)
treeb78a300e9d67c515a461e2355d36fdf6a8364d26 /tools/kitchen_sink/kitchen_sink.cpp
parenta4e4058ddbf416b0ab8302ef4b0101ec9b8ef149 (diff)
downloaduhd-513224c7f02d4639201b2d93eed12a3799604e6e.tar.gz
uhd-513224c7f02d4639201b2d93eed12a3799604e6e.tar.bz2
uhd-513224c7f02d4639201b2d93eed12a3799604e6e.zip
ks: added RX and TX subdev spec arg options
Diffstat (limited to 'tools/kitchen_sink/kitchen_sink.cpp')
-rw-r--r--tools/kitchen_sink/kitchen_sink.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/kitchen_sink/kitchen_sink.cpp b/tools/kitchen_sink/kitchen_sink.cpp
index 33fab4c86..c7265bea4 100644
--- a/tools/kitchen_sink/kitchen_sink.cpp
+++ b/tools/kitchen_sink/kitchen_sink.cpp
@@ -1103,6 +1103,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::string rx_file;
std::string time_source, clock_source;
std::string tx_ant, rx_ant;
+ std::string tx_subdev, rx_subdev;
//setup the program options
po::options_description desc("Allowed options");
@@ -1113,6 +1114,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("rate", po::value<double>(&rate)->default_value(rate), "specify to perform a TX & RX rate test (sps)")
("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-subdev", po::value<std::string>(&rx_subdev)->default_value(""), "set RX sub-device specification")
+ ("tx-subdev", po::value<std::string>(&tx_subdev)->default_value(""), "set TX sub-device specification")
("rx-otw", po::value<std::string>(&rx_otw)->default_value("sc16"), "specify the over-the-wire sample mode for RX")
("tx-otw", po::value<std::string>(&tx_otw)->default_value("sc16"), "specify the over-the-wire sample mode for TX")
("rx-cpu", po::value<std::string>(&rx_cpu)->default_value("fc32"), "specify the host/cpu sample mode for RX")
@@ -1298,7 +1301,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
usrp->set_time_source("mimo", 0);
std::cout << HEADER "Sleeping after setting clock & time sources" << std::endl;
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ boost::this_thread::sleep(boost::posix_time::seconds(1)); // MAGIC
}
else
{
@@ -1317,6 +1320,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if ((rx_channel_nums.size() > 0) || (still_set_rates))
{
+ if (rx_subdev.empty() == false)
+ {
+ usrp->set_rx_subdev_spec(rx_subdev);
+ std::cout << boost::format(HEADER_RX"RX sub-device spec: %s") % usrp->get_rx_subdev_spec().to_string() << std::endl;
+ }
+
usrp->set_rx_rate(rx_rate);
double actual_rx_rate = usrp->get_rx_rate();
std::cout << boost::format(HEADER_RX"Actual RX rate: %f") % actual_rx_rate << std::endl;
@@ -1346,6 +1355,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if ((tx_channel_nums.size() > 0) || (still_set_rates))
{
+ if (tx_subdev.empty() == false)
+ {
+ usrp->set_tx_subdev_spec(tx_subdev);
+ std::cout << boost::format(HEADER_TX"TX sub-device spec: %s") % usrp->get_tx_subdev_spec().to_string() << std::endl;
+ }
+
usrp->set_tx_rate(tx_rate);
double actual_tx_rate = usrp->get_tx_rate();
std::cout << boost::format(HEADER_TX"Actual TX rate: %f") % actual_tx_rate << std::endl;