If the data that device is sending is less than the Xfer call, then to finish the Xfer, the device needs to send a ZLP (Zero Length packet). On detecting a ZLP, the host will finish the Xfer call so you do not need to worry about the size of data coming from the device
Thank-you for your help! I'm wondering, does the CyU3PDmaSocketSetWrapUp (CY_U3P_PIB_SOCKET_0); function do what your talking about or do I still need to send a ZLP? Or both?
You need to send a ZLP. The CyU3PDmaSocketSetWrapUp will only commit the buffer, so you need to send a ZLP after that to indicate the host the end of transfer