diff options
Diffstat (limited to 'host')
-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; }; |