PORTS Forum

Ports and Interfaces => USB => Topic started by: mihooper on March 17, 2012, 12:13:34 pm

Title: Wrong bmRequestType sent by HidD_SetOutputReport?
Post by: mihooper on March 17, 2012, 12:13:34 pm
Jan,

While using the GenericHID C# application to exchange input and output reports with my device using control transfers,  I noticed that the bmRequestType is set to 0x21 (class request of the interface) by the dll call to HidD_SetOutputReport(hidHandle, outputReportBuffer, outputReportBuffer.Length + 1) in the function SendOutputReportViaControlTransfer(SafeFileHandle hidHandle, Byte[] outputReportBuffer). Isn't this supposed to be standard request instead of a class request? What would cause the HidD_SetOutputReport to send a class request (it is confusing my firmware....:)?

Here's a capture of the request.
Quote
Set Report
Allows the host to send a report to the device.
Offset Field Size Value Description
0 bmRequestType 1 21h  
 4..0: Recipient  ...00001  Interface
 6..5: Type  .01.....  Class
 7: Direction  0.......  Host-to-Device
1 bRequest 1 09h Set Report
2 wValue.LowByte 1 00h Report ID
3 wValue.HiByte 1 02h Output Report
4 wIndex 2 0000h Interface
6 wLength 2 0002h Report Length

Thx,

MikeH


[attachment deleted by admin]
Title: Re: Wrong bmRequestType sent by HidD_SetOutputReport?
Post by: Pat Crowe on March 17, 2012, 12:41:42 pm
Look at para 7.2.2 in the HID spec. A HID specific request could hardly be other than a class request.
Title: Re: Wrong bmRequestType sent by HidD_SetOutputReport?
Post by: mihooper on March 17, 2012, 01:25:19 pm
Pat,

Sorry for being new at this but, what is the "HID spec"? The USB2.0 spec, para 7.2. deals with a voltage drop budget on the physical connections to the device. I did not find a "HID spec" in the downloaded zip file from usb.org.

Mike
Title: Re: Wrong bmRequestType sent by HidD_SetOutputReport?
Post by: Pat Crowe on March 17, 2012, 02:11:38 pm
http://www.usb.org/developers/docs/hidpage/

click on 'Device Class Definition for HID 1.11'