未找到设备,libUsb .Net
public static UsbDeviceFinder MyUsbFinder = new UsbDeviceFinder(0x20DF, 0x0001);
// Find and open the usb device.
MyUsbDevice = UsbDevice.OpenUsbDevice(MyUsbFinder);
// If the device is open and ready
if (MyUsbDevice == null) throw new Exception("Device Not Found.");
请参阅下面的屏幕截图,了解我提取 VendorID 和 ProductID 的位置
alt text http://img266 .imageshack.us/img266/7197/screen1uv.png
那么为什么 USBFinder 不断返回 null 呢?
public static UsbDeviceFinder MyUsbFinder = new UsbDeviceFinder(0x20DF, 0x0001);
// Find and open the usb device.
MyUsbDevice = UsbDevice.OpenUsbDevice(MyUsbFinder);
// If the device is open and ready
if (MyUsbDevice == null) throw new Exception("Device Not Found.");
See the screen shot below for where I pulled the VendorID and ProductID
alt text http://img266.imageshack.us/img266/7197/screen1uv.png
So why does the USBFinder Keep returning null?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
老问题,但我想回答它可能对其他人有帮助。我也经历过同样的事情,直到我发现我需要为每个我想要与之通信的设备设置过滤器驱动程序。我使用过滤器向导完成此操作,该向导可以在 LibUsbDotNet 的安装路径中找到。
就我而言,我可以从“开始”->“到达它”所有程序 -> LibUsbDotNet -> libusb_win32 ->; Filter Wizard,实际执行C:\Program Files\LibUsbDotNet\libusb-win32\install-filter-win.exe
我希望这有帮助。
Old question, but I guess answering it might help someone else. I experienced the same until I found out I needed to setup the filter driver for each device I want to be able to communicate with. I did this using the Filter Wizard, which can be found in the installation path for
LibUsbDotNet
.In my case I could reach it from Start-> All Programs -> LibUsbDotNet -> libusb_win32 -> Filter Wizard, which actually executes C:\Program Files\LibUsbDotNet\libusb-win32\install-filter-win.exe
I hope that helps.
我发现 libusb 也这样做,不知道为什么,但你可以重试搜索几次。
I have found libusb does this too, not sure why, but you can retry the search a few times.