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

refactor: reuse read_serial fn with nusb #58

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Conversation

louib
Copy link
Owner

@louib louib commented Sep 8, 2024

Looks like the serial_number() function will not populate the serial number on the devices when using the nusb backend, so this PR moves the read_serial_from_device function to the generic Backend implementation, and reuses it in the nusb backend.
I also noticed that the top-level read_serial_number and the read_serial_from_device functions were exactly the same except for the interface, so we're now reusing the backend to serve the request instead of duplicating the code.

@louib louib marked this pull request as ready for review September 8, 2024 23:33
@louib louib requested a review from droidmonkey as a code owner September 8, 2024 23:33
let challenge = [0; CHALLENGE_SIZE];
let command = Command::DeviceSerial;

let d = Frame::new(challenge, command); // FIXME: do not need a challange
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess now would be a good time to fix this?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm not exactly sure how, so I'll have to handle this later. At least now we only have to fix this in one place

@louib louib merged commit b8cbad5 into master Sep 10, 2024
6 checks passed
@louib louib deleted the read-serial-from-device branch September 10, 2024 02:08
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