diff options
| author | Ashish Chaudhari <ashish@ettus.com> | 2016-02-26 14:36:26 -0800 | 
|---|---|---|
| committer | Ashish Chaudhari <ashish@ettus.com> | 2016-02-26 14:36:26 -0800 | 
| commit | 261ae74f8ecbd255417b8fcd9f2caddff7ae5977 (patch) | |
| tree | 6e3095bae2e85c087de0d6563d39437dfa2968ff | |
| parent | 586944ec2bc991d1b96c8698e5da8b39b3d36f9a (diff) | |
| download | uhd-261ae74f8ecbd255417b8fcd9f2caddff7ae5977.tar.gz uhd-261ae74f8ecbd255417b8fcd9f2caddff7ae5977.tar.bz2 uhd-261ae74f8ecbd255417b8fcd9f2caddff7ae5977.zip | |
dboards: Added APIs to get RX and TX frontend names
| -rw-r--r-- | host/include/uhd/usrp/dboard_manager.hpp | 14 | ||||
| -rw-r--r-- | host/lib/usrp/dboard_manager.cpp | 22 | 
2 files changed, 35 insertions, 1 deletions
| diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index 4a5074e50..4ce943972 100644 --- a/host/include/uhd/usrp/dboard_manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -133,6 +133,20 @@ public:          dboard_iface::sptr iface,          property_tree::sptr subtree      ); + +    virtual ~dboard_manager() {} + +    /*! +     * Returns a vector of RX frontend (subdev) names +     * \return a vector of names +     */ +    virtual const std::vector<std::string>& get_rx_frontends() const = 0; + +    /*! +     * Returns a vector of TX frontend (subdev) names +     * \return a vector of names +     */ +    virtual const std::vector<std::string>& get_tx_frontends() const = 0;  };  }} //namespace diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index 544d6d70d..6099adcbb 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -184,7 +184,15 @@ public:          dboard_iface::sptr iface,          property_tree::sptr subtree      ); -    ~dboard_manager_impl(void); +    virtual ~dboard_manager_impl(void); + +    inline const std::vector<std::string>& get_rx_frontends() const { +        return _rx_frontends; +    } + +    inline const std::vector<std::string>& get_tx_frontends() const { +        return _tx_frontends; +    }  private:      void init(dboard_id_t, dboard_id_t, property_tree::sptr); @@ -193,6 +201,8 @@ private:      //the subdevice proxy is internal to the cpp file      uhd::dict<std::string, dboard_base::sptr> _rx_dboards;      uhd::dict<std::string, dboard_base::sptr> _tx_dboards; +    std::vector<std::string>                  _rx_frontends; +    std::vector<std::string>                  _tx_frontends;      dboard_iface::sptr _iface;      void set_nice_dboard_if(void);  }; @@ -319,6 +329,11 @@ void dboard_manager_impl::init(          if (container_ctor) {              db_ctor_args.rx_container->initialize();          } + +        //Populate frontend names in-order. +        //We cannot use _xx_dboards.keys() here because of the ordering requirement +        _rx_frontends = subdevs; +        _tx_frontends = subdevs;      }      //make tx and rx subdevs (separate subdevs for rx and tx dboards) @@ -393,6 +408,11 @@ void dboard_manager_impl::init(          if (tx_cont_ctor) {              db_ctor_args.tx_container->initialize();          } + +        //Populate frontend names in-order. +        //We cannot use _xx_dboards.keys() here because of the ordering requirement +        _rx_frontends = rx_subdevs; +        _tx_frontends = tx_subdevs;      }  } | 
