From 59759a3af27cba391872a0e83a9333bea875186a Mon Sep 17 00:00:00 2001 From: Mikaela Szekely Date: Thu, 1 Oct 2020 06:43:54 -0600 Subject: [PATCH] emitters: restore default bLength for endpoint descriptors a0ceb18c89a0adafcfe9e0f9b00a74fa68c414ed broke this. --- usb_protocol/types/descriptors/standard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb_protocol/types/descriptors/standard.py b/usb_protocol/types/descriptors/standard.py index 33b5e22..223de27 100644 --- a/usb_protocol/types/descriptors/standard.py +++ b/usb_protocol/types/descriptors/standard.py @@ -96,7 +96,7 @@ EndpointDescriptor = DescriptorFormat( # Interfaces of the Audio 1.0 class extend their subordinate endpoint descriptors with # 2 additional bytes (extending it from 7 to 9 bytes). Thankfully, this is the only extension that # changes the length of a standard descriptor type, but we do have to handle this case in Construct. - "bLength" / construct.OneOf(construct.Int8ul, [7, 9]), + "bLength" / construct.Default(construct.OneOf(construct.Int8ul, [7, 9]), 7), "bDescriptorType" / DescriptorNumber(StandardDescriptorNumbers.ENDPOINT), "bEndpointAddress" / DescriptorField("Endpoint Address"), "bmAttributes" / DescriptorField("Attributes", default=2),