From 3e5898fa11d9e77421cf0d3853acc49fbf4801ca Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 21 Feb 2010 22:15:30 -0800 Subject: Made the usrp2 impl into a device. Removed the usrp device wrapper and usrp2 cpp file outside of the usrp2 lib dir. Also removed the mboard base files since we wont be needing them. --- host/lib/device.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'host/lib/device.cpp') diff --git a/host/lib/device.cpp b/host/lib/device.cpp index be27ac1ae..e376a5c50 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -15,8 +15,7 @@ // along with this program. If not, see . // -#include -#include //TODO remove and call discover from usrp +#include #include #include #include @@ -26,12 +25,7 @@ using namespace uhd; device_addrs_t device::discover(const device_addr_t &hint){ device_addrs_t device_addrs; if (not hint.has_key("type")){ - //TODO nothing - } - else if (hint["type"] == "test"){ - //make a copy of the hint for testing - device_addr_t test_device_addr = hint; - device_addrs.push_back(test_device_addr); + //TODO call discover for others and append results } else if (hint["type"] == "udp"){ std::vector usrp2_addrs = usrp::usrp2::discover(hint); @@ -58,9 +52,9 @@ device::sptr device::make(const device_addr_t &hint, size_t which){ } //create the new device with the discovered address - //TODO only a usrp device will be made (until others are supported) - if (true){ - return sptr(new uhd::usrp::usrp(device_addrs.at(which))); + //TODO only a usrp2 device will be made (until others are supported) + if (hint.has_key("type") and hint["type"] == "udp"){ + return usrp::usrp2::make(device_addrs.at(which)); } throw std::runtime_error("cant make a device"); } -- cgit v1.2.3