Hello all.
I have a problem with an old project based on Due board.
I want to report multiple sensor with USB. For now I'm using native USB, but I need to write a "driver" to understand the data flow.
That's what I'm looking on the USB HID protocol...
I have read lots of documentation but now I'm lost.
For now, I'm just trying to send sensor data to the computer and I'm looking USB data with Wireshark.
What I want to made is reducing the size of the report descriptor.
Here is an example of what I want to make:
...
USAGE_PAGE ( Generic Desktop )
USAGE ( Sensor Zone ) <= Logical Collection 0xC0 in Generic Desktop Page
COLLECTION ( Logical )
LOGICAL_MIN ( -1 )
LOGICAL_MAX ( 6000 )
REPORT_SIZE ( 16 )
REPORT_COUNT ( 1 )
SENSOR Type ( RPM ) <= Data Var 0xC1 in Generic Desktop Page
INPUT ( Const_Var_Abs )
REPORT_COUNT ( 1 )
SENSOR Type ( RPM )
INPUT ( Const_Var_Abs )
REPORT_COUNT ( 1 )
SENSOR Type ( RPM )
INPUT ( Const_Var_Abs )
END_COLLECTION
...
It's OK, it work but ... it's really big and I have more than 3 to report !
When I test:
...
USAGE_PAGE ( Generic Desktop )
USAGE ( Sensor Zone ) <= Logical Collection 0xC0 in Generic Desktop Page
COLLECTION ( Logical )
LOGICAL_MIN ( -1 )
LOGICAL_MAX ( 6000 )
REPORT_SIZE ( 16 )
REPORT_COUNT ( 3 )
SENSOR Type ( RPM ) <= Data Var 0xC1 in Generic Desktop Page
INPUT ( Const_Var_Abs )
END_COLLECTION
...
Only the first report as the RPM usage, the other are padding. Normal, it's because Const_Var_Abs flag !
Another test:
...
USAGE_PAGE ( Generic Desktop )
USAGE ( Sensor Zone ) <= Logical Collection 0xC0 in Generic Desktop Page
COLLECTION ( Logical )
LOGICAL_MIN ( -1 )
LOGICAL_MAX ( 6000 )
REPORT_SIZE ( 16 )
REPORT_COUNT ( 3 )
SENSOR Type ( RPM ) <= Data Var 0xC1 in Generic Desktop Page
INPUT ( Const_Array_Abs )
END_COLLECTION
...
Now no padding, 3 report OK, but only the report with value = LOGICAL_MIN is RPM Usage.
How can I make to have all of my report have the same usage without having to declare them manually ?