We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Thanks in Advance. I am using keil HID example and win-api to make a usb hid device for sending and receiving data using interrupt transfer. I define the package size as 64 bytes, and of cause if the data sended by the device less than 64 bytes, the host(Overlapped mode) will come up with a timeout error. And I do search in the forum, everybody says I should send a ZLP(zero length package), but I could not find any detail about what ZLP real is, and how to send a ZLP by the device or by the host. So I will appreciate if anybody tell me what can I do. Forgive my fool. Thanks again.
I have found out that I was wrong. The HID can not send data out of it's package size, but the vendor device can. I have miss them up. Am I right?
"if the data sended by the device less than 64 bytes, the host(Overlapped mode) will come up with a timeout error."
Sounds like you already send a short packet.
http://www.keil.com/forum/13037/ Tsuneo Chinzei, 20-Aug-2008 21:05 GMT For Input report over the interrupt IN endpoint, ZLP is attached to the transfer when the transfer size is just the multiple of wMaxPacketSize ( usually 64 for FS ), to show the end of transfer. That is, ZLP is attached as the short packet at the end of transfer. On other transfer size, ZLP is not required, because it is terminated by short packet.
HID exchanges reports, whose size is defined on the report descriptor. To send shorter data, you need to pad it up to the defined size. Or, define another report size on the report descriptor, using report ID.
Tsuneo
John, thank you very much.I think I have understand what you mining. In fact, I have mix up the Hid and the vendor device. Sorry to border you. Thanks again.
Thanks Tsuneo. I have got it clear. The vendor device can send any length with ZLP throught interrupt pipe, but the HID can not. I mix then up. Thanks again.
Sorry for my mistake.
Now I realize that my previous post was incorrect.
http://www.keil.com/forum/13037/ Tsuneo Chinzei, 20-Aug-2008 21:05 GMT Report descriptor declares the report format(s). HID device driver doesn't accept any report out of this format. ie. it drops such a report whose size doesn't match to any report on the report descriptor. Then, padding is required to fit to (one of) declared report size.
www.tracesystemsinc.com/.../sbook2.htm
It seems that for a HID class, there are several types of reports.?
"HID report" is general term, which collects input / output / feature reports.
The report type is determined by the place where the report passes. Interrupt IN endpoint - input report Interrupt OUT endpoint - output report EP0 IN (Get_Report request) - input / feature report EP0 OUT (Set_Report request) - output / feature report