HidLibrary icon indicating copy to clipboard operation
HidLibrary copied to clipboard

ReadReport after Timeout

Open DevLocus opened this issue 8 years ago • 3 comments

ReadReport will always fail after a timeout happens the first time. The only way I found to clear the issue is to close the handle and open a new one. I tried CancelIOex, with the handle and a null pointer, when an error during ReadFile or timeout occurs. But the ReadFile still times out while the analyzer shows data available.

DevLocus avatar Feb 07 '17 14:02 DevLocus

Can you please check if this is fixed in the latest?

ananth-racherla avatar Feb 25 '17 20:02 ananth-racherla

That helps: CancelIO if not Success:

case NativeMethods.WAIT_TIMEOUT:
                                    status = HidDeviceData.ReadStatus.WaitTimedOut;
                                    NativeMethods.CancelIo(Handle); // !!!
                                    buffer = new byte[] { };
                                    break;

teplofizik avatar May 25 '17 08:05 teplofizik

thankyou , it work @teplofizik

leotang315 avatar Aug 22 '17 02:08 leotang315