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

Extract message buffer from pipe #10

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

robin-nitrokey
Copy link
Member

This PR extracts a Buffer struct from Pipe that takes care of message fragmentation and dispatch, while Pipe implements the USB communication. This allows us to use the message buffer in other contexts, for example for unit tests, and also makes it possible to test and fuzz its functionality directly.

Previously, some internals of the pipe module were public, while parts
of the public interface where only pub(crate).  This patch fixes
visibility in the pipe module so that internals are private and the
public API is public.

It also fixes some clippy lints on the way.
Instead of resetting the pipe state after sending the error, we can
direclty write it to the endpoint as it will always fit into one init
packet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant