用于USB设备通信的C#windows app,无需使用LibUSB或WinUSB [英] C# windows app for USB device communication without using LibUSB or WinUSB

查看:1010
本文介绍了用于USB设备通信的C#windows app,无需使用LibUSB或WinUSB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,



我必须编写一个小工具来测试一个LED设备,它将通过USB连接到PC。

我做了我的研究,发现有两个广泛使用的USB通讯库:LibUSBDotNet和WinUSBDotNet



不幸的是,我不能在我的情况下使用这两个库,因为:

a)WinUSB需要设备GUID [在Inf文件中]来连接/检测设备,我现在没有。我只想使用VID和PID连接/检测设备。



b)所以,我试过可以使用VID和PID检测的LibUSB,但在我的情况下它不能找到连接的设备,直到我不使用Inf-Filter向导为特定设备的驱动程序安装过滤器。此外,即使我安装了过滤器后,我的代码也会检测到设备,但是PC进入BSOD并重新启动。所以,LibUSB现在也出局了。



你们可以帮我处理任何代码片段/链接,以便我可以编写一个小应用程序来检测USB设备和发送一些简单的byte []命令并等待SUCCESS / FAILURE确认。



任何帮助/建议将不胜感激。



谢谢

解决方案

看看#USBLib。它是基于libusb构建的,它具有基于VID和amp;的设备检测功能。 PID。下载: http://sourceforge.net/projects/sharpdevelop/files/SharpUSBLib/1.0.0.1/ [ ^ ]

Hello Everyone,

I have to write a small tool to test a LED device which will be connected to PC via USB.
I did my research and found that there are 2 widely used libraries for USB communication: LibUSBDotNet & WinUSBDotNet

Unfortunately, i cant use these 2 libraries in my case, because:
a) WinUSB needs device GUID[in Inf file] to connect / detect the devices, which i dont have now. I just want to connect/detect the device using VID and PID.

b) So, i tried LibUSB which can detect using VID & PID but in my case its not able to find the connected devices until i dont use Inf-Filter wizard to install the filter for the specific device's driver. Also, even after i install the filter, my code detects the device but the PC goes into BSOD and restarts. So, LibUSB is also out now.

Can you guys help me with any code snippet/ link so that i can write a small application just to detect a USB device and send some simple byte[] commands to it and wait for SUCCESS/FAILURE acknowledgements.

Any help/suggestion will be appreciated.

Thanks

解决方案

Have a look at #USBLib. It's built over libusb, it has device detection based on VID & PID. download: http://sourceforge.net/projects/sharpdevelop/files/SharpUSBLib/1.0.0.1/[^]


这篇关于用于USB设备通信的C#windows app,无需使用LibUSB或WinUSB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆