aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/libusb1_device_handle.cpp
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2010-08-27 12:01:16 -0700
committerThomas Tsou <ttsou@vt.edu>2010-08-27 12:01:16 -0700
commit37adb4805aeef665acd13cf975c5b59cf855d851 (patch)
tree30dc2d816f447ea9b5416c8e21fd7bac5d4ec6a9 /host/lib/transport/libusb1_device_handle.cpp
parentc9569736930cf436f340d70c7537a5f46f3ab3aa (diff)
parent98510590c453bf366d29e488c1d3b54ec022f919 (diff)
downloaduhd-37adb4805aeef665acd13cf975c5b59cf855d851.tar.gz
uhd-37adb4805aeef665acd13cf975c5b59cf855d851.tar.bz2
uhd-37adb4805aeef665acd13cf975c5b59cf855d851.zip
Merge branch 'usrp1_cleanup' into usrp1
Diffstat (limited to 'host/lib/transport/libusb1_device_handle.cpp')
-rw-r--r--host/lib/transport/libusb1_device_handle.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/host/lib/transport/libusb1_device_handle.cpp b/host/lib/transport/libusb1_device_handle.cpp
index f80090f15..5289f668f 100644
--- a/host/lib/transport/libusb1_device_handle.cpp
+++ b/host/lib/transport/libusb1_device_handle.cpp
@@ -88,6 +88,16 @@ usb_device_handle::sptr make_usb_device_handle(libusb_device *dev)
device_addr));
}
+bool check_fsf_device(libusb_device *dev)
+{
+ libusb_device_descriptor desc;
+
+ if (libusb_get_device_descriptor(dev, &desc) < 0) {
+ UHD_ASSERT_THROW("USB: failed to get device descriptor");
+ }
+
+ return desc.idVendor == 0xfffe;
+}
std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list()
{
@@ -105,7 +115,8 @@ std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list()
ssize_t i = 0;
for (i = 0; i < cnt; i++) {
libusb_device *dev = list[i];
- device_list.push_back(make_usb_device_handle(dev));
+ if (check_fsf_device(dev))
+ device_list.push_back(make_usb_device_handle(dev));
}
libusb_free_device_list(list, 0);