Skip to content
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

support Enumerate by (vid, pid)[] #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flier268
Copy link

No description provided.

@flier268
Copy link
Author

Maybe i can't use Tuple, because it is too new.

@amullins83
Copy link
Collaborator

I agree that it would be useful to not need to provide a Usage ID to the Enumerate method. I think a simpler way to implement this would be adding a default value of 0 to the UsageID parameter on the existing method, and then consider 0 to mean "any usage". The documentation I found for HID Usage 0 seems to indicate that it would be valid to use it this way.

@@ -0,0 +1,8 @@
namespace HidLibrary.unit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been away from active open-source C# development for a long time, so I may just be behind on naming conventions. What was the purpose for the "unit" namespace and why did you choose that name for this?

@@ -0,0 +1,8 @@
namespace HidLibrary.unit
{
public class Tuple_VidPid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really unwieldy name for this class, unless it adheres to a new C# convention I don't know about. It's not actually a tuple, since it's just a regular C# data object. It seems like something along these lines could be useful, but it should probably include a UsageID property and be called something like HidDeviceDescription, and we should use it inside HidDevice as well, possibly as the underlying data storage for the properties it describes.

@amullins83
Copy link
Collaborator

RE: HID Usage Tables documentation: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants