usb_protocol.types.descriptor module
Type elements for defining USB descriptors.
- class usb_protocol.types.descriptor.BCDFieldAdapter(subcon)[source]
Bases:
Adapter
Construct adapter that dynamically parses BCD fields.
- class usb_protocol.types.descriptor.DescriptorField(description='', default=None, *, length=None)[source]
Bases:
Subconstruct
Construct field definition that automatically adds fields of the proper size to Descriptor definitions.
- LENGTH_TYPES = {1: <FormatField>, 2: <FormatField>, 3: <BytesInteger>, 4: <FormatField>, 8: <FormatField>}
- USB_TYPES = {'b': <FormatField>, 'bcd': <BCDFieldAdapter <FormatField>>, 'bm': <FormatField>, 'i': <FormatField>, 'id': <FormatField>, 'w': <FormatField>}