Ports
May 23, 2013, 08:51:06 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: Simple HidD_SetOutputReport outputReportBuffer length question  (Read 994 times)
robbycon
Member
*
Posts: 2



« on: April 26, 2012, 05:58:30 pm »

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
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1629


WWW
« Reply #1 on: April 26, 2012, 09: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

Logged
robbycon
Member
*
Posts: 2



« Reply #2 on: April 27, 2012, 12: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?
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1629


WWW
« Reply #3 on: April 27, 2012, 01: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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!