Usage of SetXferSize in CyAPI.lib

Question: Is the function SetXferSize of the CyAPI needed?



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


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.