summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-30 15:11:23 -0700
committerJosh Blum <josh@joshknows.com>2010-03-30 15:11:23 -0700
commit281307833c8275031bd2469e6aef3f472490749a (patch)
tree2ffe095d5f4a741c65cfee08f52adc43e5cf148a /host/lib
parentf9be69cae7c0fd9bca8b310ff79dd6aad958dc2b (diff)
downloaduhd-281307833c8275031bd2469e6aef3f472490749a.tar.gz
uhd-281307833c8275031bd2469e6aef3f472490749a.tar.bz2
uhd-281307833c8275031bd2469e6aef3f472490749a.zip
use find to discover devices
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/device.cpp8
-rw-r--r--host/lib/usrp/usrp1e/usrp1e_none.cpp2
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp7
3 files changed, 8 insertions, 9 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp
index ca45d0795..27a365d34 100644
--- a/host/lib/device.cpp
+++ b/host/lib/device.cpp
@@ -57,23 +57,23 @@ static size_t hash_device_addr(
/***********************************************************************
* Registration
**********************************************************************/
-typedef boost::tuple<device::discover_t, device::make_t> dev_fcn_reg_t;
+typedef boost::tuple<device::find_t, device::make_t> dev_fcn_reg_t;
// instantiate the device function registry container
UHD_SINGLETON_FCN(std::vector<dev_fcn_reg_t>, get_dev_fcn_regs)
void device::register_device(
- const discover_t &discover,
+ const find_t &find,
const make_t &make
){
//std::cout << "registering device" << std::endl;
- get_dev_fcn_regs().push_back(dev_fcn_reg_t(discover, make));
+ get_dev_fcn_regs().push_back(dev_fcn_reg_t(find, make));
}
/***********************************************************************
* Discover
**********************************************************************/
-device_addrs_t device::discover(const device_addr_t &hint){
+device_addrs_t device::find(const device_addr_t &hint){
device_addrs_t device_addrs;
BOOST_FOREACH(const dev_fcn_reg_t &fcn, get_dev_fcn_regs()){
diff --git a/host/lib/usrp/usrp1e/usrp1e_none.cpp b/host/lib/usrp/usrp1e/usrp1e_none.cpp
index 1c8cf9a5b..84fb9276c 100644
--- a/host/lib/usrp/usrp1e/usrp1e_none.cpp
+++ b/host/lib/usrp/usrp1e/usrp1e_none.cpp
@@ -25,7 +25,7 @@ using namespace uhd::usrp;
* when the required kernel module headers are not present.
*/
-device_addrs_t usrp1e::discover(const device_addr_t &){
+device_addrs_t usrp1e::find(const device_addr_t &){
return device_addrs_t(); //return empty list
}
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 9dce351be..b0ee395fb 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -30,13 +30,13 @@ using namespace uhd::transport;
namespace asio = boost::asio;
UHD_STATIC_BLOCK(register_usrp2_device){
- device::register_device(&usrp2::discover, &usrp2::make);
+ device::register_device(&usrp2::find, &usrp2::make);
}
/***********************************************************************
* Discovery over the udp transport
**********************************************************************/
-uhd::device_addrs_t usrp2::discover(const device_addr_t &hint){
+uhd::device_addrs_t usrp2::find(const device_addr_t &hint){
device_addrs_t usrp2_addrs;
//if no address was specified, send a broadcast on each interface
@@ -50,7 +50,7 @@ uhd::device_addrs_t usrp2::discover(const device_addr_t &hint){
new_hint["addr"] = if_addrs.bcast;
//call discover with the new hint and append results
- device_addrs_t new_usrp2_addrs = usrp2::discover(new_hint);
+ device_addrs_t new_usrp2_addrs = usrp2::find(new_hint);
usrp2_addrs.insert(usrp2_addrs.begin(),
new_usrp2_addrs.begin(), new_usrp2_addrs.end()
);
@@ -83,7 +83,6 @@ uhd::device_addrs_t usrp2::discover(const device_addr_t &hint){
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["transport"] = "udp";
new_addr["addr"] = ip_addr.to_string();
usrp2_addrs.push_back(new_addr);
//dont break here, it will exit the while loop