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

cross mob

Usage of SetXferSize in CyAPI.lib

Usage of SetXferSize in CyAPI.lib

Anonymous
Not applicable
Question: Is the function SetXferSize of the CyAPI needed?

 

Answer:

SetXferSize is used in conjunction with the cyusb.sys driver to establish the transfer size.  The need to set this is application dependent.  Without setting a transfer size with SetXferSize the cyusb.sys driver will use a default transfer size of 8*packet size.  An example of setting the transfer size to another value is:

ULONG xferSz = 1024 * 19

MyDevice->BulkInEndpt->SetXferSize(xferSz);

Selecting an Alternate Interface will cause the driver default transfer size to be used again so the developer will need to reset the transfer size again after selecting an Alternate Interface. The maximum value for SetXferSize is endpoint and OS dependent. However large values are not recommended, the recommended value for endpoints other than control endpoint is 64kB.

0 Likes
495 Views
Contributors