Browse Source

emitters: restore default bLength for endpoint descriptors

a0ceb18c89 broke this.
main
Mikaela Szekely 4 years ago
parent
commit
2e78bb6739
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      usb_protocol/types/descriptors/standard.py

+ 1
- 1
usb_protocol/types/descriptors/standard.py View File

@@ -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),


Loading…
Cancel
Save