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

Add write_iter and endpoint_with_additional_data methods #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Windfisch
Copy link

Hi,

USB Audio Class devices (including MIDI devices) extend the endpoint descriptor by two additional bytes, bRefresh and bSynchAddress (c.f. the USB MIDI 1.0 spec on page 25/26).

Currently, usb-device offers no way to create such an endpoint. I've added such a function and also a more generic way to write() into the descriptor: write_iter accepts an iterator instead of a slice, allowing for more flexibility using e.g. chained iterators.

I would be happy if this could be merged as it should not cause any incompatibilities.

It would be possible to replace the endpoint() method's implementation body by just a call to endpoint_with_additional_data() with an empty iterator at a tiny runtime cost.

If you prefer to have this change as well or have anything else to discuss, please let me know!

@JosefUtbult
Copy link

@Windfisch Hi there. I've been working on trying to get an asynchronous endpoint to work for my soundcard, but I ran into the same problem as you with the lack of fields in the endpoint descriptor. I've been looking through your pull request, but I have a hard time understanding how it should be applied when creating an endpoint. Would you mind helping me? Thanks in advance

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