aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-15 12:15:33 -0700
committerJosh Blum <josh@joshknows.com>2010-03-15 12:15:33 -0700
commit7590f187d0414fd05e23828488166bc4bc88df26 (patch)
tree20eb597e4614276120814b727486c50e95f234fd /host/lib/usrp/usrp2/usrp2_impl.cpp
parent1ba6aafa678cdf61aef44de1d22ec72653e87ec7 (diff)
downloaduhd-7590f187d0414fd05e23828488166bc4bc88df26.tar.gz
uhd-7590f187d0414fd05e23828488166bc4bc88df26.tar.bz2
uhd-7590f187d0414fd05e23828488166bc4bc88df26.zip
Device sub classes can register themselves. Simplifies device.cpp internals.
Added static instance macro for lazy instantiation of static variables.
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp5
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 58c82303f..850a738d4 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -26,6 +26,10 @@ using namespace uhd::usrp;
using namespace uhd::transport;
namespace asio = boost::asio;
+STATIC_BLOCK(register_device){
+ device::register_device(&usrp2::discover, &usrp2::make);
+}
+
/***********************************************************************
* Discovery over the udp transport
**********************************************************************/
@@ -57,7 +61,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["type"] = "usrp2";
new_addr["transport"] = "udp";
new_addr["addr"] = ip_addr.to_string();
usrp2_addrs.push_back(new_addr);