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

Document timeout unit, add non_blocking read/write interrupts #20

Closed
flukejones opened this issue Apr 24, 2020 · 3 comments
Closed

Document timeout unit, add non_blocking read/write interrupts #20

flukejones opened this issue Apr 24, 2020 · 3 comments

Comments

@flukejones
Copy link

I'd been using micros for the timeout of an interrupt read and this was causing some very very janky behaviour that I was struggling to debug. The docs don't mention the unit required for timeouts and it seems 1 millisecond is the lowest I can go.

It would also be nice to have a non-blocking read/write_interrupt call.

@a1ien
Copy link
Owner

a1ien commented Apr 24, 2020

Non-blocking mode in it's hard implement using async, await and future. You can read this #3 (comment).

I add info about timeout in documentation.

Also you can try use unsafe libusb1-sys crate and get async function from native libusb
5a38c32
This old async code

@zoumi
Copy link

zoumi commented Dec 30, 2020

If the USB device send data to PC while a read timeout happening, the data will be discarded?

@a1ien
Copy link
Owner

a1ien commented Dec 31, 2020

If the USB device send data to PC while a read timeout happening, the data will be discarded?

This can't happen. Becouse all transaction start by host. If host not request device can't anything send

a1ien added a commit that referenced this issue Apr 26, 2021
Export metadata for dependent crates
@a1ien a1ien closed this as completed in cdfe31c Sep 2, 2021
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

No branches or pull requests

3 participants