Hi Piotr,
On 27/02/2020 12:01, Piotr Caban wrote:
Hi Gabriel,
On 26 Feb 2020, at 14:03, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
if (element.caps.value.IsRange || element.caps.value.ReportCount <= 1 || !element.bitCount)
return HIDP_STATUS_NOT_VALUE_ARRAY;
Do you know what happens when usages range and reports count doesn’t match?
I’m asking about a HID descriptor that looks like that: USAGE_MINIMUM 1 USAGE_MAXIMUM 2 REPORT_SIZE 8 REPORT_COUNT 20 INPUT … I wonder if the remaining reports are used as padding or if USAGE 2 is a value array.
Thanks, Piotr
As far as I understand from MSDN, if IsRange is TRUE, then it cannot be a value array at all. IsRange has to be FALSE and then ReportCount has an overloaded meaning: the number of elements in the array.
Unfortunately I haven't been able to test such corner cases because no controller reported such values (to give an error). We'd need some virtual device driver to be able to see what Windows does in these cases. So I had to go by what MSDN states and use the error codes appropriately.
Thanks, Gabriel