diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-07-17 18:44:48 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-07-17 18:44:48 -0700 |
commit | 3d5176874f90f9155c1591656df8a7d663b3c712 (patch) | |
tree | 3693c123057a9420b273f595e6609fb32343130c /host/lib/usrp/x300 | |
parent | 47c853f9dd518ef25d23b94bc0e77dbda3c2ddab (diff) | |
parent | 684fd3a3ffaf31b9fa726ccf2fdea2627f6ea10d (diff) | |
download | uhd-3d5176874f90f9155c1591656df8a7d663b3c712.tar.gz uhd-3d5176874f90f9155c1591656df8a7d663b3c712.tar.bz2 uhd-3d5176874f90f9155c1591656df8a7d663b3c712.zip |
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 1c8eeab51..1e22f7fb7 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -332,7 +332,21 @@ device_addrs_t x300_find(const device_addr_t &hint_) //call discover with the new hint and append results device_addrs_t new_addrs = x300_find(new_hint); - addrs.insert(addrs.begin(), new_addrs.begin(), new_addrs.end()); + //if we are looking for a serial, only add the one device with a matching serial + if (hint.has_key("serial")) { + bool found_serial = false; //signal to break out of the interface loop + for (device_addrs_t::iterator new_addr_it=new_addrs.begin(); new_addr_it != new_addrs.end(); new_addr_it++) { + if ((*new_addr_it)["serial"] == hint["serial"]) { + addrs.insert(addrs.begin(), *new_addr_it); + found_serial = true; + break; + } + } + if (found_serial) break; + } else { + // Otherwise, add all devices we find + addrs.insert(addrs.begin(), new_addrs.begin(), new_addrs.end()); + } } } |