what's the implication of the setxfersize() on earth?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,everyone,

   

In my test programme, when I write   "BulkInEpt1->SetXferSize(1048576);  "  the programme transfer 4MB data in about 120ms . But when I write  "BulkInEpt1->SetXferSize(1048576*4);  " the  programme transfer 4MB data in 1000 ms, note that i write also "BulkInEpt1->WaitForXfer(&inOvLap1,1000);" in my programme. the 1000ms means time out.

   

Furthermore, to enhance the transferring speed, I once used four endpoints. the code is below:

   

BulkInEpt1->SetXferSize(1048576);
 BulkInEpt2->SetXferSize(1048576);
 BulkInEpt3->SetXferSize(1048576);
 BulkInEpt4->SetXferSize(1048576);

   

UCHAR  *inContext1 = BulkInEpt1->BeginDataXfer(m_pImageBuffer1, length, &inOvLap1);
 UCHAR  *inContext2 = BulkInEpt2->BeginDataXfer(m_pImageBuffer2, length, &inOvLap2);
 UCHAR  *inContext3 = BulkInEpt3->BeginDataXfer(m_pImageBuffer3, length, &inOvLap3);
 UCHAR  *inContext4 = BulkInEpt4->BeginDataXfer(m_pImageBuffer4, length, &inOvLap4);

   

    BulkInEpt1->WaitForXfer(&inOvLap1,1000);
 BulkInEpt2->WaitForXfer(&inOvLap2,1000);
 BulkInEpt3->WaitForXfer(&inOvLap3,1000);
 BulkInEpt4->WaitForXfer(&inOvLap4,1000);

   

    BulkInEpt1->FinishDataXfer(m_pImageBuffer1, length, &inOvLap1,inContext1);
 BulkInEpt2->FinishDataXfer(m_pImageBuffer2, length, &inOvLap2,inContext2);
 BulkInEpt3->FinishDataXfer(m_pImageBuffer3, length, &inOvLap3,inContext3);
 BulkInEpt4->FinishDataXfer(m_pImageBuffer4, length, &inOvLap4,inContext4);

   

I transferred 1MB in each endpoint, but it cost 4s to finish the transferring, it's so incredible, what's the matter? and how to use multiple endpoints?

   

so what's the implication of the setxfersize() on earth? Does this code set the buffer size of  the USB2.0 host controller to be 1048576 bytes? or the driver transfer the data to application software's memmory when it receives 1048576 bytes data one time?

0 Likes
1 Reply
Anonymous
Not applicable

SetXferSize() sets the size of buffer to be used by the host controller driver for a particular endpoint. http://msdn.microsoft.com/en-us/library/ms790486.aspx documents the limitation on the value that can be used for the buffer size.

   

Regards,

   

Anand

0 Likes