summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp12
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp12
2 files changed, 20 insertions, 4 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 6cdd6f280..5e36a19dd 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -33,6 +33,7 @@
#include <boost/thread/thread.hpp>
#include <boost/lexical_cast.hpp>
#include "b100_regs.hpp"
+#include <cstdio>
using namespace uhd;
using namespace uhd::usrp;
@@ -57,8 +58,15 @@ static device_addrs_t b100_find(const device_addr_t &hint)
//since an address is intended for a different, non-USB, device.
if (hint.has_key("addr")) return b100_addrs;
- boost::uint16_t vid = hint.has_key("uninit") ? FX2_VENDOR_ID : B100_VENDOR_ID;
- boost::uint16_t pid = hint.has_key("uninit") ? FX2_PRODUCT_ID : B100_PRODUCT_ID;
+ unsigned int vid, pid;
+
+ if(hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type") && hint["type"] == "b100") {
+ sscanf(hint.get("vid").c_str(), "%x", &vid);
+ sscanf(hint.get("pid").c_str(), "%x", &pid);
+ } else {
+ vid = B100_VENDOR_ID;
+ pid = B100_PRODUCT_ID;
+ }
// Important note:
// The get device list calls are nested inside the for loop.
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index dbf7a5092..fe4541d38 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -33,6 +33,7 @@
#include <boost/filesystem.hpp>
#include <boost/thread/thread.hpp>
#include <boost/lexical_cast.hpp>
+#include <cstdio>
using namespace uhd;
using namespace uhd::usrp;
@@ -61,8 +62,15 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
//since an address is intended for a different, non-USB, device.
if (hint.has_key("addr")) return usrp1_addrs;
- boost::uint16_t vid = hint.has_key("uninit") ? FX2_VENDOR_ID : USRP1_VENDOR_ID;
- boost::uint16_t pid = hint.has_key("uninit") ? FX2_PRODUCT_ID : USRP1_PRODUCT_ID;
+ unsigned int vid, pid;
+
+ if(hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type") && hint["type"] == "usrp1") {
+ sscanf(hint.get("vid").c_str(), "%x", &vid);
+ sscanf(hint.get("pid").c_str(), "%x", &pid);
+ } else {
+ vid = USRP1_VENDOR_ID;
+ pid = USRP1_PRODUCT_ID;
+ }
// Important note:
// The get device list calls are nested inside the for loop.