未找到设备,libUsb .Net

发布于 2024-09-11 23:32:34 字数 552 浏览 6 评论 0原文

 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷迭香的记忆 2024-09-18 23:32:34

老问题,但我想回答它可能对其他人有帮助。我也经历过同样的事情,直到我发现我需要为每个我想要与之通信的设备设置过滤器驱动程序。我使用过滤器向导完成此操作,该向导可以在 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.

唯憾梦倾城 2024-09-18 23:32:34

我发现 libusb 也这样做,不知道为什么,但你可以重试搜索几次。

I have found libusb does this too, not sure why, but you can retry the search a few times.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文