From eae0bec99bca5efa1e86faa03132ec5e8aca5fe5 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 20 Apr 2010 12:05:33 -0700 Subject: Created args string contructor for device address. Using the args string for the find devices app. Added documentation to simple usrp. --- host/lib/usrp/simple_usrp.cpp | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'host/lib/usrp/simple_usrp.cpp') 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().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().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().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().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(); + 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() + % _mboard[MBOARD_PROP_NAME].as() + % _rx_dsp[DSP_PROP_NAME].as() + % _rx_dboard[DBOARD_PROP_NAME].as() + % _rx_subdev[SUBDEV_PROP_NAME].as() + % _tx_dsp[DSP_PROP_NAME].as() + % _tx_dboard[DBOARD_PROP_NAME].as() + % _tx_subdev[SUBDEV_PROP_NAME].as() + ); } /******************************************************************* @@ -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)); } -- cgit v1.2.3