I've regularly read that a transfer should end with a ZLP (Zero-length packet) if the last packet transmitted is of full size. A short packets ends a transfer, but a full-size packet would not end the transfer if the client requested more data than the host can provide. Sending a ZLP would then mark the end of the transfer.
Right now, NAKs are sent if there is not data available anymore. If the client expected more data, it will timeout (thus adding delay in the app).
Todo:
-> check what the USB2 spec says.
-> implement the ZLP for control transfers that are hardcoded in the USB drivers
-> maybe add an option in "send" functions like "last_packet_in_transfer", so that a ZLP is sent if there is no data left and the user does not forget about it
I've regularly read that a transfer should end with a ZLP (Zero-length packet) if the last packet transmitted is of full size. A short packets ends a transfer, but a full-size packet would not end the transfer if the client requested more data than the host can provide. Sending a ZLP would then mark the end of the transfer.
Right now, NAKs are sent if there is not data available anymore. If the client expected more data, it will timeout (thus adding delay in the app).
Todo: -> check what the USB2 spec says. -> implement the ZLP for control transfers that are hardcoded in the USB drivers -> maybe add an option in "send" functions like "last_packet_in_transfer", so that a ZLP is sent if there is no data left and the user does not forget about it