I'm using CyU3PUartTransmitBytes function to do register-based transfers on an FX3. CyU3PUartTransmitBytes is passed a count parameter ("number of bytes to be transferred") and returns "number of bytes that are successfully transferred". How to handle the situation where the number of bytes successfully transferred is not the same as the number of bytes to be transferred? Will CyU3PReturnStatus_t != CY_U3P_SUCCESS if not all the data is successfully transferred?
CyU3PUartTransmitBytes() returns "the number of bytes that are successfully transferred" but the status of this API is either 'success' or 'timeout'.
So, if there is some problem and the number of bytes that are transferred successfully doesn't match the number of bytes to be transferred (count), the API will return status = timeout and the return value = number of bytes transferred successfully, which is same as (CyU3PReturnStatus_t != CY_U3P_SUCCESS).
So, in order to handle such a situation, the API has to be called again but with an updated pointer to the data and the count size according to the data that is left to be sent in the previous operation.