Author Topic: Simple HidD_SetOutputReport outputReportBuffer length question  (Read 15750 times)

robbycon

  • Member
  • ***
  • Posts: 2
Hi, I am basing an application off the GenericHid.cs program, and I have a simple question.  I want to send 46,080 bytes (256 * 180) of data with the MyHid.SendOutputReportViaControlTransfer function.  I want to know: do I have to call this function in a for loop 720 times (46,080 bytes / 64 bytes per packet), or can I call it once with a byte[] of size 46,080 and will the hid.dll will take care of the 64 byte packets?  Thank you,

  -Robby

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Simple HidD_SetOutputReport outputReportBuffer length question
« Reply #1 on: April 26, 2012, 10:00:31 pm »
The HID report descriptor defines the size of the reports.

A report can be > one packet or transaction.

A call to HidD_SetOutputReport sends one report.

Control transfers have no guaranteed bandwidth, so the transfer might take some time.

Jan


robbycon

  • Member
  • ***
  • Posts: 2
Re: Simple HidD_SetOutputReport outputReportBuffer length question
« Reply #2 on: April 27, 2012, 01:00:53 pm »
Thank you for your reply.  So another question because I haven't had my coffee yet: can I use an HidD_GetInputReport function and define the ReportBufferLength as the same 46,080 byte length (and expect the application to be hung until all the data is received)?  Or is the max buffer length I can define the 512 (on Windows XP and later) based on http://msdn.microsoft.com/en-us/library/windows/hardware/ff539686(v=vs.85).aspx?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Simple HidD_SetOutputReport outputReportBuffer length question
« Reply #3 on: April 27, 2012, 02:59:42 pm »
512 is the maximum number of reports the HID driver's buffer will hold.

HidD_GetInputReport will return when a complete report, as defined in the device's report descriptor, is available or on timeout (5 secs.)

Jan