Skip to content

u2fhid: Write as many bytes as possible #123

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

NickeZ
Copy link
Collaborator

@NickeZ NickeZ commented May 7, 2025

To be more efficient multiple u2fhid packets are written simultaneously if possible

Should be carefully tested on all platforms. A good test is the firmware upgrade as it for sure tries to send larger packets.

@NickeZ NickeZ requested a review from benma May 7, 2025 07:59
@NickeZ NickeZ force-pushed the nickez/write-all-u2fhid-packets branch 6 times, most recently from 67c394b to baf52a8 Compare May 8, 2025 08:26
Copy link
Contributor

@benma benma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with small comment nit

out.Write(readBuffer.Next(contPayloadSize))
}

// Make out buffer multiple of writeReportSize bytes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this comment. How about Pad to a multiple of 64?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

To be more efficient multiple u2fhid packets are written simultaneously
if possible
@NickeZ NickeZ force-pushed the nickez/write-all-u2fhid-packets branch from bb9d96c to 8e05da0 Compare May 8, 2025 09:17
@NickeZ NickeZ merged commit e5b786c into BitBoxSwiss:master May 8, 2025
3 checks passed
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.

2 participants