- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What doesn WaitForXfer do? Is there source code?
Can WaitForXfer be replaced by other Windows wait functions, like WaitForMultipleObjects?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You can get the source code from https://www.cypress.com/documentation/software-and-drivers/ez-usb-fx3-software-development-kit CyUSB3_USB_Suite_Source.zip.
The waitforXfer API is executed using WaitForSingleObject
public bool WaitForXfer(IntPtr ovlapEvent, uint tOut)
{
Int32 waitResult = PInvoke.WaitForSingleObject(ovlapEvent, tOut);
if (waitResult == CyConst.WAIT_OBJECT_0)
{
return true;
}
return false;
}
Please let me know if any queries on this
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
WaitForXfer is generally used for asynchronous transfers unlike XferData .You will usually want to use the synchronous XferData method rather than the asynchronous BeginDataXfer/WaitForXfer/FinishDataXfer approach.
Correct me if i am wrong, as per my understanding of WaitForMultipleObjects function determines whether the wait criteria have been met. If the criteria have not been met, the calling thread enters the wait state until the conditions of the wait criteria have been met or the time-out interval elapses. This might not involve usb transfer.
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to use asynchronous IO.
Internally WaitForXfer should call something like WaitForSingleObject, can you check this?
Your understanding is right. Besides WaitForMultipleObjects can wait for multiple objects (one of them is the CYUSB OVERLAPPED object) and returns when any of them is ready, this is what is needed. This is why WaitForMultipleObjects should be used instead of WaitForXfer - WaitForXfer can only wait for the OVERLAPPED object of CYUSB object internally.
Can you check what WaitForXfer do besides WaitForSingleObject?
Or can other wait functions like WaitForMultipleObjects be put before WaitForXfer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You can get the source code from https://www.cypress.com/documentation/software-and-drivers/ez-usb-fx3-software-development-kit CyUSB3_USB_Suite_Source.zip.
The waitforXfer API is executed using WaitForSingleObject
public bool WaitForXfer(IntPtr ovlapEvent, uint tOut)
{
Int32 waitResult = PInvoke.WaitForSingleObject(ovlapEvent, tOut);
if (waitResult == CyConst.WAIT_OBJECT_0)
{
return true;
}
return false;
}
Please let me know if any queries on this
Regards,
Rashi
Rashi