PORTS Forum
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
This forum is closed to new activity.
The posts are available to browse, but posting has been disabled. BIG THANKS to all who have participated and shared your knowledge over the past 13 years.
Aug 11, 2023
Home
Help
Search
Login
Register
PORTS Forum
»
Ports and Interfaces
»
USB
»
Read Timeout?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read Timeout? (Read 14223 times)
vanweric
Member
Posts: 24
Read Timeout?
«
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
Logged
Ray
Member
Posts: 13
Re: Read Timeout?
«
Reply #1 on:
December 13, 2011, 07:50:19 pm »
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
Check the Usbhidio_vc6 link down the page.
Ray.
«
Last Edit: March 28, 2018, 08:25:16 pm by Jan Axelson
»
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 3033
Re: Read Timeout?
«
Reply #2 on:
December 13, 2011, 10:27:28 pm »
Yes, and my Filestream example uses a timeout as well. Both are here:
http://www.janaxelson.com/hidpage.htm#MyExampleCode
Jan
«
Last Edit: March 28, 2018, 08:25:23 pm by Jan Axelson
»
Logged
Print
Pages: [
1
]
« previous
next »
PORTS Forum
»
Ports and Interfaces
»
USB
»
Read Timeout?