diff options
| author | Josh Blum <josh@joshknows.com> | 2010-04-29 06:29:54 +0000 | 
|---|---|---|
| committer | Josh Blum <josh@joshknows.com> | 2010-04-29 06:29:54 +0000 | 
| commit | ef678a479cc4d4d60e16300e8654d19ebb6e43f0 (patch) | |
| tree | da968df0580f1043b353d76ed550a56b35864974 /host/lib/device.cpp | |
| parent | 4e97e9c4845814994e1e9d3deabb5abd4d177738 (diff) | |
| parent | c7df3878779cf461cef01d910e6c52c7ac3e1105 (diff) | |
| download | uhd-ef678a479cc4d4d60e16300e8654d19ebb6e43f0.tar.gz uhd-ef678a479cc4d4d60e16300e8654d19ebb6e43f0.tar.bz2 uhd-ef678a479cc4d4d60e16300e8654d19ebb6e43f0.zip  | |
Merge branch 'master' of git@ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib/device.cpp')
| -rw-r--r-- | host/lib/device.cpp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp index 706f64951..88bd2cff4 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -97,11 +97,6 @@ device::sptr device::make(const device_addr_t &hint, size_t which){      BOOST_FOREACH(const dev_fcn_reg_t &fcn, get_dev_fcn_regs()){          BOOST_FOREACH(device_addr_t dev_addr, fcn.get<0>()(hint)){ -            //copy keys that were in hint but not in dev_addr -            //this way, we can pass additional transport arguments -            BOOST_FOREACH(const std::string &key, hint.keys()){ -                if (not dev_addr.has_key(key)) dev_addr[key] = hint[key]; -            }              //append the discovered address and its factory function              dev_addr_makers.push_back(dev_addr_make_t(dev_addr, fcn.get<1>()));          } @@ -127,6 +122,12 @@ device::sptr device::make(const device_addr_t &hint, size_t which){      size_t dev_hash = hash_device_addr(dev_addr);      //std::cout << boost::format("Hash: %u") % dev_hash << std::endl; +    //copy keys that were in hint but not in dev_addr +    //this way, we can pass additional transport arguments +    BOOST_FOREACH(const std::string &key, hint.keys()){ +        if (not dev_addr.has_key(key)) dev_addr[key] = hint[key]; +    } +      //map device address hash to created devices      static uhd::dict<size_t, boost::weak_ptr<device> > hash_to_device;  | 
