0

I've got a microcontroller unit and I need to connect it to PC via USB. I've already created its HID descriptor and it's up and running on Windows but I need a C#/WPF application to communicate with it (Read/Write). There's no built-in library for USB in C# (.NET) so I searched the web long enough but can't find a way to perform this task. I found many solutions on Github but they don't seem to work with me. Could anyone help me with a USB library that's straightforward and easy to use? Thanks very much in advance.

asked Oct 9, 2020 at 21:07

1 Answer 1

1

I recommend checking out this library https://archive.codeplex.com/?p=simplehidlibrary This one has a demo app and also references other solutions for communicating with HID devices.

If these don't work for you, you can still write your own implementation using P/Invoke based on official HID API documentation from Microsoft: https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/introduction-to-hid-concepts

Happy hacking!

Update for 2024: Since the original response is about 4 years old now, the original link I posted doesn't work anymore. The lib is still available here - http://www.java2s.com/Open-Source/CSharp_Free_Code/DotNet_Assembly/Download_Simple_HID_Library.htm However, it may be a good time to look at a different library like https://github.com/mikeobrien/HidLibrary with almost 6 hundred stars and 3 hundred forks on GitHub.

answered Nov 17, 2020 at 20:54
Sign up to request clarification or add additional context in comments.

2 Comments

The first link (archive.codeplex.com/?p=simplehidlibrary) is broken.
@fabianoriccardi, since the original response is about 4 years old now, it's quite natural. One link that still works is java2s.com/Open-Source/CSharp_Free_Code/DotNet_Assembly/… However, it may be a good time to look for a different library like github.com/mikeobrien/HidLibrary with almost 6 hundred stars and 3 hundred forks on github.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.