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

Implement support for CDC composite gadget #31

Open
Chapnik13 opened this issue Apr 30, 2021 · 3 comments
Open

Implement support for CDC composite gadget #31

Chapnik13 opened this issue Apr 30, 2021 · 3 comments

Comments

@Chapnik13
Copy link

Device info:
cdc composite gadget
cdc composite gadget configuration

I could not use the polyfill to communicate with the device, It stated that there was no in endpoint, and then I changed the alternates and the interfaces that it communicate with but then I got error when I tried to send the control bits.

Maybe it is just some configuration that needed to change?
Thanks for your help

@reillyeon
Copy link
Collaborator

When picking the interfaces manually are you sure you picked interfaces 2 and 3? Interfaces 0 and 1 form a USB CDC Ethernet device while 2 and 3 form a USB CDC ACM device. The existing code for interface selection probably can't quite tell the difference and needs to learn to interpret the subclass code. The device probably also has interface association descriptors which aren't currently exposed through WebUSB which would help with this detection.

@Chapnik13
Copy link
Author

I probably made a mistake and didn't claim interfaces 2 and 3.

I changed the code again and verified that these are the interfaces that are claimed and it works now.

Changing the code to depend on the subclass and class alone is not enough because there are two interfaces with class 10 and subclass 0, I added a check for the alternates

Is it enough to be an all purpose general solution?
If it is I can make a pr

@reillyeon
Copy link
Collaborator

Create a PR and we can discuss the particular detection logic. Without parsing interface association descriptors we probably just want to use the heuristic that the class 10 interface must follow the class 2, subclass 2 interface.

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