Author Topic: WinUSB read/write  (Read 5600 times)

lcpoon

  • Frequent Contributor
  • ****
  • Posts: 58
WinUSB read/write
« on: October 18, 2013, 09:55:10 am »
Is that possible to check if the device is pending for read before we call ReadDataViaBulkTransfer() or SendViaBulkTransfers()?

Due to certain reason, I need to set the pipeTimeout = 0. In this case, if the device is pending for read and SendViaBulkTransfers() is being called, the program will hang forever.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: WinUSB read/write
« Reply #1 on: October 18, 2013, 10:09:23 am »
Use asynchronous reads that signal when data is available. I have example code here:

http://www.janaxelson.com/winusb.htm
« Last Edit: July 13, 2014, 09:58:13 pm by Jan Axelson »