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

Fix EndpointDescriptor #26

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

Conversation

twam
Copy link
Contributor

@twam twam commented Feb 19, 2022

Fix creation of EndpointDescriptor and add unit tests for both possible
lengths.

Fix creation of EndpointDescriptor and add unit tests for both possible
lengths.
@antoinevg
Copy link
Member

Your PR is failing the test_descriptor_collection unit test:

got:      [9, 2, 32, 0, 1, 1, 0, 128, 250, 9, 4, 1, 0, 2, 255, 255, 255, 0, 9, 5, 129, 2, 64, 0, 255, 9, 5, 1, 2, 64, 0, 255] 
expected: [9, 2, 32, 0, 1, 1, 0, 128, 250, 9, 4, 1, 0, 2, 255, 255, 255, 0, 7, 5, 129, 2, 64, 0, 255, 7, 5, 1, 2, 64, 0, 255] 

# Configuration descriptor, with subordinates.

Your approach works when creating the descriptor using EndpointDescriptor.build() but using the context manager syntax with i.EndpointDescriptor() as e: the descriptor's bLength field will be set to 9 even when the optional fields aren't specified.

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