diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-15 17:54:29 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-15 17:54:29 -0700 |
commit | 25005946ad796c41d3108480eb2b3e39a68f24b2 (patch) | |
tree | ecdaaa61e6bf5346a3b7a6fe36d5e843ae1c1acb /host/lib | |
parent | 6f9ce938de36476de68720e8090e9a92d0f2fefe (diff) | |
download | uhd-25005946ad796c41d3108480eb2b3e39a68f24b2.tar.gz uhd-25005946ad796c41d3108480eb2b3e39a68f24b2.tar.bz2 uhd-25005946ad796c41d3108480eb2b3e39a68f24b2.zip |
usrp2: added a type to the address args to filter based on type usrp2
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 58f0696b5..0837f4ac4 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -44,6 +44,9 @@ UHD_STATIC_BLOCK(register_usrp2_device){ uhd::device_addrs_t usrp2::find(const device_addr_t &hint){ device_addrs_t usrp2_addrs; + //return an empty list of addresses when type is set to non-usrp2 + if (hint.has_key("type") and hint["type"] != "usrp2") return usrp2_addrs; + //if no address was specified, send a broadcast on each interface if (not hint.has_key("addr")){ BOOST_FOREACH(const if_addrs_t &if_addrs, get_if_addrs()){ @@ -88,7 +91,7 @@ uhd::device_addrs_t usrp2::find(const device_addr_t &hint){ //make a boost asio ipv4 with the raw addr in host byte order boost::asio::ip::address_v4 ip_addr(ntohl(ctrl_data_in->data.ip_addr)); device_addr_t new_addr; - new_addr["name"] = "USRP2"; + new_addr["type"] = "usrp2"; new_addr["addr"] = ip_addr.to_string(); usrp2_addrs.push_back(new_addr); //dont break here, it will exit the while loop |