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

Data reading! #80

Open
fabio-ric-silva opened this issue Sep 12, 2023 · 1 comment
Open

Data reading! #80

fabio-ric-silva opened this issue Sep 12, 2023 · 1 comment

Comments

@fabio-ric-silva
Copy link

Could someone help me with a simple example of reading 64 bytes?

On the examples, there is no kind example! Just writing!

@jrowberg
Copy link

Normally, you can't read on demand at the USB transport layer; it would be inefficient to transfer data in this way. At best, you would design your peripheral USB device to accept a written command and then push data back in response using a raw HID report or similar.

Along those lines, the raw_data.py example is probably the closest to what you want to see. This lets your PC-side app listen for new data coming from the peripheral device, and then the device just pushes whatever data it wants to whenever it's available:

https://github.com/rene-aguirre/pywinusb/blob/master/examples/raw_data.py

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

2 participants