PORTS Forum
Ports and Interfaces => USB => Topic started by: vanweric on December 13, 2011, 07:31:07 pm
-
I'm looking to implement a read timeout on the host for my HID device. Do you have any of your examples implement this?
I tried wrapping the file handle in a FileStream, but the created stream doesn't support timeouts.
Thank You
- Eric
-
Eric,
I would think that you are after the overlapped call to CreateFile, and subsequent ReadFile call and then use the WaitForSingleObject to set a timeout. Jan has an example of this here:
http://www.lvr.com/hidpage.htm#MyExampleCode (http://www.janaxelson.com/hidpage.htm#MyExampleCode)
Check the Usbhidio_vc6 link down the page.
Ray.
-
Yes, and my Filestream example uses a timeout as well. Both are here:
http://www.janaxelson.com/hidpage.htm#MyExampleCode
Jan