-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get a list of USBDeviceInfo[] or a single USBDevice based on VID & PID #13
Comments
The project on codeplex is not the same project, however if you have code to share you can add a pull request here. |
Hi, I am interested on this too. Is there any workaround? I am struggling to find the correct GUID for the device I am trying to connect to. |
Same here. Being able to get a device from VID and PID bypassing GUIDs would be awesome. EDIT: I've found this: https://stackoverflow.com/a/13928035/4574 So |
If that works that may be an easy solution. The device still needs to have a winusb driver though to be able to access it. |
My use case is to automate measurements by sending commands and reading info from a USB to GPIB bridge. |
Mine is just experimenting. I want to control a USB device from a 8 bit computer that of course doesn't have any drivers for it (it doesn't have the concept of "drivers" to start with), the device is poorly documented so I need to work out the appropriate USB requests in a trial-and-error-ish fashion. Doing that on my PC with your library is going to be a lot easier than directly on the target computer. |
If you are creating the driver (well .inf file) yourself you will have to choose your own GUID anyway so you can use that in your code. If there is an existing driver it has to use WinUSB to be able to use it, and you can also find the GUID in the existing drivers. |
I know that.. However, the GUID is never documented by driver's developers and it took me several hours to find the correct one on the Windows registries. Other libraries work with VID and PID, but are more complex to use. I think adding this feature would make this library much more developer-friendly. |
Simple implementationstatic USBDeviceInfo GetDeviceInfoByVidPid(string guid, UInt16 vid, UInt16 pid)
{
USBDeviceInfo[] infoList = USBDevice.GetDevices(guid);
return infoList.FirstOrDefault(info => info.VID == vid && info.PID == pid);
}
static USBDeviceInfo GetDeviceInfoByVidPid(Guid guid, UInt16 vid, UInt16 pid)
{
USBDeviceInfo[] infoList = USBDevice.GetDevices(guid);
return infoList.FirstOrDefault(info => info.VID == vid && info.PID == pid);
} How to set correct GUID?There are two way I use to create WinUSB boilerplate
The key of GUID is the following part.
|
Add two methods in USBDevice
I might have solution for that and I tried to reach out on Codeplex. Pls get back to me.
The text was updated successfully, but these errors were encountered: