Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review usage of Zero-length Packets (ZLPs) #5

Closed
kauwua opened this issue Dec 15, 2023 · 1 comment
Closed

Review usage of Zero-length Packets (ZLPs) #5

kauwua opened this issue Dec 15, 2023 · 1 comment
Labels
question Further information is requested

Comments

@kauwua
Copy link
Collaborator

kauwua commented Dec 15, 2023

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

@kauwua kauwua added the enhancement New feature or request label Dec 15, 2023
@kauwua kauwua added question Further information is requested and removed enhancement New feature or request labels Apr 17, 2024
@kauwua kauwua changed the title Use ZLP for transmissions that end with a full-size packet Review usage of Zero-length Packets (ZLPs) Apr 17, 2024
@kauwua
Copy link
Collaborator Author

kauwua commented Jun 4, 2024

Fixed by #12

@kauwua kauwua closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant