diff options
author | Josh Blum <josh@joshknows.com> | 2011-03-29 17:27:17 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-03-29 17:27:17 -0700 |
commit | 48f6e1f8aae24ee4ff3b15232cfc335b0210ed11 (patch) | |
tree | 847fafa93829313d092ae51f917f829088f07567 /host/lib/usrp/usrp1 | |
parent | 32357927bdc52b0cc7cd7b6d18457932aaa79682 (diff) | |
download | uhd-48f6e1f8aae24ee4ff3b15232cfc335b0210ed11.tar.gz uhd-48f6e1f8aae24ee4ff3b15232cfc335b0210ed11.tar.bz2 uhd-48f6e1f8aae24ee4ff3b15232cfc335b0210ed11.zip |
usrp1: ignore claimed interfaces, avoids the problem of discovery when one device is claimed
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index 7005c59f2..a99777775 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -86,7 +86,11 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) } //std::cout << "USRP1 firmware image: " << usrp1_fw_image << std::endl; - usrp_ctrl::make(usb_control::make(handle))->usrp_load_firmware(usrp1_fw_image); + usb_control::sptr control; + try{control = usb_control::make(handle);} + catch(const uhd::exception &){continue;} //ignore claimed + + usrp_ctrl::make(control)->usrp_load_firmware(usrp1_fw_image); } //get descriptors again with serial number, but using the initialized VID/PID now since we have firmware @@ -94,7 +98,11 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) pid = USRP1_PRODUCT_ID; BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) { - usrp1_iface::sptr iface = usrp1_iface::make(usrp_ctrl::make(usb_control::make(handle))); + usb_control::sptr control; + try{control = usb_control::make(handle);} + catch(const uhd::exception &){continue;} //ignore claimed + + usrp1_iface::sptr iface = usrp1_iface::make(usrp_ctrl::make(control)); device_addr_t new_addr; new_addr["type"] = "usrp1"; new_addr["name"] = iface->mb_eeprom["name"]; |