<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">For my device I am able to send and receive data with no issues if I hardcode the ReportID in hid_set_output_report. I am stuck on how to programatically determine the total size of an output report and then to specify using a specific report. For my device I am supposed to find an appropriately sized report and use that report for the message that I want to send. Right now I am just sending all messages to the same report.<br><br>For my device when I run lsusb -vvv I get the following output reports. There are more but for sake of a brief example lets just look at reports 0x0d, 0x0e, and 0x0f. Note, for all of the input and output reports there is only one usage page.<br><br> Item(Global): Usage Page, data= [ 0x00 0xff ]
65280<br> (null)<br> Item(Local ): Usage, data= [ 0x01 ] 1<br> (null)<br> Item(Main ): Collection, data= [ 0x01 ] 1<br> Application<br> Item(Global): Report Size, data= [ 0x08 ] 8<br> Item(Global): Logical Maximum, data= [ 0x80 0x00 ] 128<br> Item(Global): Logical Minimum, data= [ 0x00 ] 0<br> Item(Local ): Usage, data= [ 0x01 ] 1<br>
(null)<br><br> Item(Global): Report ID, data= [ 0x0d ] 13<br> Item(Global): Report Count, data= [ 0x05 ] 5<br> Item(Main ): Output, data= [ 0x02 0x01 ] 258<br> Data Variable Absolute No_Wrap Linear<br> Preferred_State No_Null_Position Non_Volatile Buffered Bytes<br> Item(Local ): Usage, data= [ 0x01 ] 1<br> (null)<br> Item(Global): Report ID, data= [ 0x0e ] 14<br> Item(Global): Report Count, data= [ 0x09 ] 9<br> Item(Main ): Output, data= [ 0x02 0x01 ] 258<br> Data
Variable Absolute No_Wrap Linear<br> Preferred_State No_Null_Position Non_Volatile Buffered Bytes<br> Item(Local ): Usage, data= [ 0x01 ] 1<br> (null)<br> Item(Global): Report ID, data= [ 0x0f ] 15<br> Item(Global): Report Count, data= [ 0x0d ] 13<br> Item(Main ): Output, data= [ 0x02 0x01 ] 258<br> Data Variable Absolute No_Wrap Linear<br> Preferred_State No_Null_Position Non_Volatile Buffered Bytes<br>
Item(Local ): Usage, data= [ 0x01 ] 1<br> (null)<br><br>For report 0x0d the total size is 5 counts * 8 bytes = 40 bytes. <br>For report 0x0e the total size is 9 counts * 8 bytes = 72 bytes.<br>For report 0x0f the total size is 13 counts * 8 bytes = 104 bytes.<br><br>Here is a identification dump. According to the example program test_libhid.c you select the appropriate path and pass that into hid_set_output_report. But if I set the PATH_IN[] variable to the below value I can only select the first report. I don't see a way to select the other reports. Each report has the same PATH!<br><br> int const PATH_IN[] = { 0xff000001 };<br><br>0xff000001.0xff000001; type: 0x90 Report ID: 0x0d Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0d Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0d Size:
8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0d Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0d Size: 8<br>0xff000001.0xff000001; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0e Size: 8<br>0xff000001.0xff000001; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID:
0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br>0xff000001.0x00000000; type: 0x90 Report ID: 0x0f Size: 8<br><br>Finally, if I go into function hid_set_output_report in hid_exchange.c and hardcode the ReportID I can send to any report that I want to.<br><br>hidif->hid_data->ReportID = 0x0d;<br><br>So, I have two questions.<br><br>1) How can I determine the total size of each report? The Size variable <br>is always 8 bytes and I don't see a Count variable.<br>2) How can I figure out the appropriate PATH_INT to pass to his_set_output_report() to select the
appropriate ReportID?<br><br>Any help would be greatly appreciated!<br>Jeff</td></tr></table><br>