Ports and Interfaces > USB

help with request types

<< < (2/4) > >>

Jan Axelson:
I'm not sure if you have it all figured out or not.

But another point to be aware of is:

Under Windows, the host uses interrupt transfers to send and receive reports UNLESS the application uses a HidD_Get/Set function OR the HID doesn't have an interrupt OUT endpoint.

ulao:
No not all figure out.. the report mixing is still confusing me. I just figured out one of my issues. I need to know why feature report 2 shows a length of feature report 18. This really is causing issues in my code. It very clearly says the length is 4 + RID (5) not 132, and not 9. Very confused by this....




Yes I see your point. I have a two endpoints

 7,          /* sizeof(usbDescrEndpoint) */
    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */
    0x81,       // bulk IN endpoint number 1
    0x03,       /* attrib: Interrupt endpoint */
    8, 0,       /* maximum packet size */
    0x08, /* in ms*/

//the output.

    7,          // sizeof(usbDescrEndpoint)
    USBDESCR_ENDPOINT,  // descriptor type = endpoint
    0x01,        // out endpoint
    0x03,       // attrib: Interrupt endpoint
    8, 0,       // maximum packet size
    0x08, // in ms

I see these endpoints and I wrote an application that uses HID get/set and I use an application that sends bulk data.

the part that was confusing me was how my driver deals with control and int/bulk separately. Now that I have that understood things are making more sense. All but this size confusion.
 

Jan Axelson:
The comments here appear to be incorrect:

Report count is 131 decimal:

0x95, 0x79,                    //   REPORT_COUNT (127) -- the max

Report count is 128 decimal:

0x95, 0x80,                    //   REPORT_COUNT (131) -- the max

I don't know what you mean by "it is getting the size from the report id 18"

What happens when you attempt to set or get feature report 2? Is the Setup packet correct? How much data does the host or device send?

Also, HIDs do interrupt and control transfers, not bulk.

ulao:

--- Quote ---Also, HIDs do interrupt and control transfers, not bulk.
--- End quote ---
That helps, so I know its int. then.

About the reports.
0x80 was a test  forgot to change it back to 83
0x79 was an error sholuld have been 0x7f
0x95, 0x83,                    //   REPORT_COUNT (131) -- the max
0x95, 0x7f,                    //   REPORT_COUNT (127) -- the max
This could explain some of the stalls I get.

 "it is getting the size from the report id 18"
yeah I know hard to explain. I'll try from scratch.

feature report id 2 is a size of 5 (including the report id) as defined in the descriptor.  When I see the USB data in the sniffer The report size shows 132. If I remove the report feature 18 from my descriptor and run the sniffer the length for report ID 2 changes to 9. (now conflicting with another report I guess). Like I mentioned it should be 5.

It is almost like the descriptor is some how mangled and it reading the wrong length for that report id.


What happens when you attempt to set or get feature report 2? It works just as it should and very often stalls. When it stall I just retry. but as I said above the length is wrong. It is expecting 132 bytes not 5.


Is the Setup packet correct? - The packets show the right data.


How much data does the host or device send? for report id (feature) only 5 bytes. Even though it is asking for 132.







Jan Axelson:
Yes, it looks like the descriptor has an error in it somewhere. One approach would be to start with a simpler version, get it working, then add to it.

Under Windows, before each change to the descriptors, use Device Manager to uninstall the device so Windows doesn't try to use the previously stored descriptors.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version