aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/simple_usrp.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-20 12:05:33 -0700
committerJosh Blum <josh@joshknows.com>2010-04-20 12:05:33 -0700
commiteae0bec99bca5efa1e86faa03132ec5e8aca5fe5 (patch)
tree12a51e33d54293e2b7911f202fc5ae233fdae7ae /host/lib/usrp/simple_usrp.cpp
parent6b015b1c517733e85cb0c08a379e8d20377bf2fa (diff)
downloaduhd-eae0bec99bca5efa1e86faa03132ec5e8aca5fe5.tar.gz
uhd-eae0bec99bca5efa1e86faa03132ec5e8aca5fe5.tar.bz2
uhd-eae0bec99bca5efa1e86faa03132ec5e8aca5fe5.zip
Created args string contructor for device address.
Using the args string for the find devices app. Added documentation to simple usrp.
Diffstat (limited to 'host/lib/usrp/simple_usrp.cpp')
-rw-r--r--host/lib/usrp/simple_usrp.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/host/lib/usrp/simple_usrp.cpp b/host/lib/usrp/simple_usrp.cpp
index 11ee3a798..321d66a4a 100644
--- a/host/lib/usrp/simple_usrp.cpp
+++ b/host/lib/usrp/simple_usrp.cpp
@@ -42,14 +42,14 @@ public:
_tx_dsp = _mboard[MBOARD_PROP_TX_DSP];
//extract rx subdevice
- wax::obj rx_dboard = _mboard[MBOARD_PROP_RX_DBOARD];
- std::string rx_subdev_in_use = rx_dboard[DBOARD_PROP_USED_SUBDEVS].as<prop_names_t>().at(0);
- _rx_subdev = rx_dboard[named_prop_t(DBOARD_PROP_SUBDEV, rx_subdev_in_use)];
+ _rx_dboard = _mboard[MBOARD_PROP_RX_DBOARD];
+ std::string rx_subdev_in_use = _rx_dboard[DBOARD_PROP_USED_SUBDEVS].as<prop_names_t>().at(0);
+ _rx_subdev = _rx_dboard[named_prop_t(DBOARD_PROP_SUBDEV, rx_subdev_in_use)];
//extract tx subdevice
- wax::obj tx_dboard = _mboard[MBOARD_PROP_TX_DBOARD];
- std::string tx_subdev_in_use = tx_dboard[DBOARD_PROP_USED_SUBDEVS].as<prop_names_t>().at(0);
- _tx_subdev = tx_dboard[named_prop_t(DBOARD_PROP_SUBDEV, tx_subdev_in_use)];
+ _tx_dboard = _mboard[MBOARD_PROP_TX_DBOARD];
+ std::string tx_subdev_in_use = _tx_dboard[DBOARD_PROP_USED_SUBDEVS].as<prop_names_t>().at(0);
+ _tx_subdev = _tx_dboard[named_prop_t(DBOARD_PROP_SUBDEV, tx_subdev_in_use)];
}
~simple_usrp_impl(void){
@@ -61,7 +61,26 @@ public:
}
std::string get_name(void){
- return _mboard[MBOARD_PROP_NAME].as<std::string>();
+ return str(boost::format(
+ "Simple USRP:\n"
+ " Device: %s\n"
+ " Mboard: %s\n"
+ " RX DSP: %s\n"
+ " RX Dboard: %s\n"
+ " RX Subdev: %s\n"
+ " TX DSP: %s\n"
+ " TX Dboard: %s\n"
+ " TX Subdev: %s\n"
+ )
+ % (*_dev)[DEVICE_PROP_NAME].as<std::string>()
+ % _mboard[MBOARD_PROP_NAME].as<std::string>()
+ % _rx_dsp[DSP_PROP_NAME].as<std::string>()
+ % _rx_dboard[DBOARD_PROP_NAME].as<std::string>()
+ % _rx_subdev[SUBDEV_PROP_NAME].as<std::string>()
+ % _tx_dsp[DSP_PROP_NAME].as<std::string>()
+ % _tx_dboard[DBOARD_PROP_NAME].as<std::string>()
+ % _tx_subdev[SUBDEV_PROP_NAME].as<std::string>()
+ );
}
/*******************************************************************
@@ -174,6 +193,8 @@ private:
wax::obj _mboard;
wax::obj _rx_dsp;
wax::obj _tx_dsp;
+ wax::obj _rx_dboard;
+ wax::obj _tx_dboard;
wax::obj _rx_subdev;
wax::obj _tx_subdev;
};
@@ -181,6 +202,6 @@ private:
/***********************************************************************
* The Make Function
**********************************************************************/
-simple_usrp::sptr simple_usrp::make(const std::string &args){
- return sptr(new simple_usrp_impl(device_addr_t::from_args_str(args)));
+simple_usrp::sptr simple_usrp::make(const device_addr_t &dev_addr){
+ return sptr(new simple_usrp_impl(dev_addr));
}