- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could somebody give me a help.
I want to set the timeout of BulkInEndPt, but it seems that it doesn't work normally.
For example, I set timeout to 5ms, m_pCyUSBDevice->BulkInEndPt->TimeOut = 5;
If XferData returns and fails, it takes about 55ms. I think It should be 5ms or just a little more than 5ms. Am I wrong?
And if XferData returns and succeeds, if will takes much more than 5ms sometimes. I think it should be timeout.
What's more, I repeat reading data from USB device, and I am sure USB device have data, but it will stop reading data for more than 30ms sometimes. I find it by wireshark.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try to measure the function time using clock(). Here is the snippet of the code:
#include <time.h>
clock_t start, end;
double cpu_time_used;
start = clock();
... /* Do the work. */
end = clock();
cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
Please test and update on the forum.
Thanks & Regards
Abhinav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
- Please explain how you have confirmed the timeout value.
- Kindly, share USB traces captured using a protocol analyzer to debug.
Best regards,
Srinath S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use QTime::currentTime to record the time,and then call XferData to read data from USB Device. After XferData returns, I use QTime::currentTime to substract the time I recorded before. That is the mothed to confirm the timeout value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try to measure the function time using clock(). Here is the snippet of the code:
#include <time.h>
clock_t start, end;
double cpu_time_used;
start = clock();
... /* Do the work. */
end = clock();
cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
Please test and update on the forum.
Thanks & Regards
Abhinav