diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2017-11-07 15:28:38 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:06 -0800 |
commit | 5e5f40923974c94eaacccd46bd3ba19fb9955982 (patch) | |
tree | 28e628d6eaf302648b59dae8c5281a015444e2eb /host/lib/usrp/mpmd | |
parent | 23e11875386ebae3651144529bfb4fdee86a5436 (diff) | |
download | uhd-5e5f40923974c94eaacccd46bd3ba19fb9955982.tar.gz uhd-5e5f40923974c94eaacccd46bd3ba19fb9955982.tar.bz2 uhd-5e5f40923974c94eaacccd46bd3ba19fb9955982.zip |
mpm: added additional filtering to mpm find routine
mpm_find now filters discovered devices using (if provided in args)
name, serial, type, and product. This method follows the same logic as
the x300 find routine.
Diffstat (limited to 'host/lib/usrp/mpmd')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index cada95345..58b5682c1 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -493,7 +493,19 @@ device_addrs_t mpmd_find_with_addr(const device_addr_t& hint_) boost::token_compress_on); new_addr[value[0]] = value[1]; } - addrs.push_back(new_addr); + // filter the discovered device below by matching optional keys + if ( + (not hint_.has_key("name") or hint_["name"] == new_addr["name"]) + and (not hint_.has_key("serial") or hint_["serial"] == new_addr["serial"]) + and (not hint_.has_key("type") or hint_["type"] == new_addr["type"]) + and (not hint_.has_key("product") or hint_["product"] == new_addr["product"]) + ){ + addrs.push_back(new_addr); + } else { + UHD_LOG_DEBUG("MPMD FIND", + "Found device, but does not match hint: " << recv_addr + ); + } } return addrs; }; |