aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/device.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-02-21 22:15:30 -0800
committerJosh Blum <josh@joshknows.com>2010-02-21 22:15:30 -0800
commit3e5898fa11d9e77421cf0d3853acc49fbf4801ca (patch)
tree8f04464a8246bcfdb858a27c313adc614427c469 /host/lib/device.cpp
parentadd5d32f9b0cb3cda15624fb7aef3998096ff3f6 (diff)
downloaduhd-3e5898fa11d9e77421cf0d3853acc49fbf4801ca.tar.gz
uhd-3e5898fa11d9e77421cf0d3853acc49fbf4801ca.tar.bz2
uhd-3e5898fa11d9e77421cf0d3853acc49fbf4801ca.zip
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.
Diffstat (limited to 'host/lib/device.cpp')
-rw-r--r--host/lib/device.cpp16
1 files changed, 5 insertions, 11 deletions
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 <http://www.gnu.org/licenses/>.
//
-#include <uhd/usrp/usrp.hpp>
-#include <uhd/usrp/usrp2.hpp> //TODO remove and call discover from usrp
+#include <uhd/usrp/usrp2.hpp>
#include <uhd/device.hpp>
#include <boost/format.hpp>
#include <stdexcept>
@@ -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<device_addr_t> 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");
}