hi Jan!
Host application perform
Overlapped read USB HID Device.
Did I understand correctly:
1. Device have REPORT_SIZE = 5, Hid driver (or windows) add extra byte for Packed ID. Overall length of REPORT is 6.
3-rd papameter of ReadFile() is nNumberOfBytesToRead. If I specify nNumberOfBytesToRead to 6 - everything works fine.
And now I want read 3 report at a time (6*3=18) bytes.
Now I specify nNumberOfBytesToRead as 18 and perform Overlapped read. As soon as Host received first report -WaitForSingleObject() returns "WAIT_OBJECT_0" and GetOverlappedResult return lpNumberOfBytesTransferred as 6. And Buffer-receiver contain only 6 bytes.
As you said here:
HIDfaq says:
Why does ReadFile hang my application when I request to read a report?ReadFile returns when one of more reports of the expected size are available or on a timeout if implemented.
But how can i wait for receiveng
several reports?
Perform:
received=0;
While (received<18){
ReadFile()
WaitForSingleObject()
GetOverlappedResult(...,&received,..);
}