Replies: 2 comments
|
Changing the following two lines fixes the round-trip problem, but probably breaks reconstruction of the HID descriptor: EncodedItem.cs : L160 change and EncodedItem:L162 change |
0 replies
|
I've found the same problem and same solution, but I don't understand why it would break anything. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
TL;DR
When creating instance of EncodedItem
if DataValueSigned = X where
(X > Int16.MinValue && X < 0) || (X > Int16.MaxValue)Then DataValueSigned cannot be round tripped and later accessed DataItems have a wrong value.
Use case
I'm trying to get Logical min and max values from a USB device under Windows. The logical minimum in the hid descriptor is -512.
The later accessed DataItem contains a logical minimum of 0.
I've managed to narrow it down to EncodedItem.cs, line 162
But I cannot for the life of me understand the logic behind EncodedItem.Data.
Steps to reproduce with VS 2022:
Open HidSharp project
In Visual Studio Menu, go to View > Other Windows > C# Interactive
In Solution Explorer, right click HidSharp Project and choose
Initialize Interactive with ProjectIn Interactive Console, enter the following:
EncodedItem.DataValueSigned=0Observations
If anyone has an Idea how to correct this without breaking anything else, I would appreciate the help.
Diego
All reactions