usb_protocol documentation
usb_protocol
usb_protocol package
Subpackages
usb_protocol.emitters package
Subpackages
usb_protocol.emitters.descriptors package
Submodules
usb_protocol.emitters.descriptors.cdc module
Convenience emitters for CDC descriptors.
usb_protocol.emitters.descriptors.microsoft10 module
Convenience emitters Microsoft OS 1.0 Descriptors.
- class usb_protocol.emitters.descriptors.microsoft10.ExtendedCompatIDDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates a ExtendedCompatIDDescriptor
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- Function()
Context manager that allows addition of a function section to the descriptor.
It can be used with a with statement; and yields an ExtendedCompatIDDescriptorFunctionEmitter that can be populated:
- with d.Function() as f:
f.bFirstInterfaceNumber = 0 f.compatibleID = ‘WINUSB’
This adds the relevant descriptor, automatically.
- class usb_protocol.emitters.descriptors.microsoft10.ExtendedPropertiesDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates a ExtendedPropertiesDescriptor
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- Property()
Context manager that allows addition of a property section to the descriptor.
It can be used with a with statement; and yields an ExtendedPropertiesDescriptorSectionEmitter that can be populated:
- with d.Property() as p:
p.dwPropertyDataType = RegistryTypes.REG_EXPAND_SZ p.PropertyName = “Icons” p.PropertyData = “%SystemRoot%system32shell32.dll,-233”
This adds the relevant descriptor, automatically.
- class usb_protocol.emitters.descriptors.microsoft10.ExtendedPropertiesDescriptorSectionEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates a ExtendedPropertiesDescriptorSection
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- class usb_protocol.emitters.descriptors.microsoft10.MicrosoftOS10DescriptorCollection
Bases:
objectObject that builds a full collection of Microsoft OS 1.0 descriptors.
- ExtendedCompatIDDescriptor()
- ExtendedPropertiesDescriptor()
- add_descriptor(descriptor, index=None)
Adds a descriptor to our collection.
- Parameters:
descriptor – The descriptor to be added.
index – The index of the relevant descriptor. Defaults to None.
usb_protocol.emitters.descriptors.midi1 module
Convenience emitters for USB MIDI Class 1 descriptors.
- class usb_protocol.emitters.descriptors.midi1.ClassSpecificMidiStreamingBulkDataEndpointDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitter- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- add_associated_jack(jackID)
- add_subordinate_descriptor(subordinate)
Adds a subordinate descriptor to the relevant descriptor.
- Parameter:
- subordinate – The subordinate descriptor to add; can be an emitter,
or a bytes-like object.
- class usb_protocol.emitters.descriptors.midi1.ClassSpecificMidiStreamingInterfaceDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitter- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- class usb_protocol.emitters.descriptors.midi1.MidiOutJackDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitter- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- add_source(sourceId, sourcePin=1)
- add_subordinate_descriptor(subordinate)
Adds a subordinate descriptor to the relevant descriptor.
- Parameter:
- subordinate – The subordinate descriptor to add; can be an emitter,
or a bytes-like object.
usb_protocol.emitters.descriptors.standard module
Convenience emitters for simple, standard descriptors.
- class usb_protocol.emitters.descriptors.standard.BinaryObjectStoreDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates a BinaryObjectStore descriptor.
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat +nonbuild>
- SuperSpeedUSBDeviceCapability()
Context manager that allows addition of a SS Device Capability to this Binary Object Store.
It can be used with a with statement; and yields an SuperSpeedUSBDeviceCapabilityDescriptorEmitter that can be populated:
- with bos.SuperSpeedUSBDeviceCapability() as e:
e.wSpeedSupported = 0b1110 e.bFunctionalitySupport = 1
This adds the relevant descriptor, automatically.
- USB2Extension()
Context manager that allows addition of a USB 2.0 Extension to this Binary Object Store.
It can be used with a with statement; and yields an USB2ExtensionDescriptorEmitter that can be populated:
- with bos.USB2Extension() as e:
e.bmAttributes = 1
This adds the relevant descriptor, automatically.
- class usb_protocol.emitters.descriptors.standard.ConfigurationDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates a configuration descriptor.
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- InterfaceAssociationDescriptor()
Context manager that allows addition of a subordinate interface association descriptor.
It can be used with a with statement; and yields an InterfaceAssociationDescriptorEmitter that can be populated:
- with configuration.InterfaceAssociationDescriptor() as d:
d.bFirstInterface = 0 d.bInterfaceCount = 2 [snip]
This adds the relevant descriptor, automatically.
- InterfaceDescriptor()
Context manager that allows addition of a subordinate interface descriptor.
It can be used with a with statement; and yields an InterfaceDescriptorEmitter that can be populated:
- with interface.InterfaceDescriptor() as d:
d.bInterfaceNumber = 0x01 [snip]
This adds the relevant descriptor, automatically. Note that populating derived fields such as bNumEndpoints aren’t necessary; they’ll be populated automatically.
- class usb_protocol.emitters.descriptors.standard.DeviceDescriptorCollection(automatic_language_descriptor=True)
Bases:
objectObject that builds a full collection of descriptors related to a given USB device.
- ConfigurationDescriptor()
Context manager that allows addition of a configuration descriptor.
It can be used with a with statement; and yields an ConfigurationDescriptorEmitter that can be populated:
- with collection.ConfigurationDescriptor() as d:
d.bConfigurationValue = 1 [snip]
This adds the relevant descriptor, automatically. Note that populating derived fields such as bNumInterfaces aren’t necessary; they’ll be populated automatically.
- DEFAULT_SUPPORTED_LANGUAGES = [LanguageIDs.ENGLISH_US]
- DeviceDescriptor()
Context manager that allows addition of a device descriptor.
It can be used with a with statement; and yields an DeviceDescriptorEmitter that can be populated:
- with collection.DeviceDescriptor() as d:
d.idVendor = 0xabcd d.idProduct = 0x1234 [snip]
This adds the relevant descriptor, automatically.
- __init__(automatic_language_descriptor=True)
- Parameters:
automatic_language_descriptor – If set or not provided, a language descriptor will automatically – be added if none exists.
- __iter__()
Allow iterating over each of our descriptors; yields (index, value, descriptor).
- add_descriptor(descriptor, index=0, descriptor_type=None)
Adds a descriptor to our collection.
- Parameters:
descriptor – The descriptor to be added.
index – The index of the relevant descriptor. Defaults to 0.
descriptor_type – The type of the descriptor to be added. If `None`, this is automatically derived from the descriptor contents.
- add_language_descriptor(supported_languages=None)
Adds a language descriptor to the list of device descriptors.
- Parameters:
supported_languages – A list of languages supported by the device.
- ensure_string_field_is_index(field_value)
Processes the given field value; if it’s not an string index, converts it to one.
Non-index-fields are converted to indices using get_index_for_string, which automatically adds the relevant fields to our string descriptor collection.
- get_descriptor_bytes(type_number: int, index: int = 0)
Returns the raw, binary descriptor for a given descriptor type/index.
- Parmeters:
type_number – The descriptor type number. index – The index of the relevant descriptor, if relevant.
- get_index_for_string(string)
Returns an string descriptor index for the given string.
If a string descriptor already exists for the given string, its index is returned. Otherwise, a string descriptor is created.
- class usb_protocol.emitters.descriptors.standard.EmitterTests(methodName='runTest')
Bases:
TestCase- test_automatic_language_descriptor()
- test_configuration_emitter()
- test_descriptor_collection()
- test_empty_descriptor_collection()
- test_string_emitter()
- test_string_emitter_function()
- class usb_protocol.emitters.descriptors.standard.EndpointDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates an InterfaceDescriptor.
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- SuperSpeedCompanion()
Context manager that allows addition of a SuperSpeed Companion to this endpoint descriptor.
It can be used with a with statement; and yields an SuperSpeedEndpointCompanionDescriptorEmitter that can be populated:
- with endpoint.SuperSpeedEndpointCompanion() as d:
d.bMaxBurst = 1
This adds the relevant descriptor, automatically.
- class usb_protocol.emitters.descriptors.standard.InterfaceAssociationDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates an interface association descriptor.
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- class usb_protocol.emitters.descriptors.standard.InterfaceDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitterEmitter that creates an InterfaceDescriptor.
- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
- EndpointDescriptor(*, add_default_superspeed=False)
Context manager that allows addition of a subordinate endpoint descriptor.
It can be used with a with statement; and yields an EndpointDesriptorEmitter that can be populated:
- with interface.EndpointDescriptor() as d:
d.bEndpointAddress = 0x01 d.bmAttributes = 0x80 d.wMaxPacketSize = 64 d.bInterval = 0
This adds the relevant descriptor, automatically.
- class usb_protocol.emitters.descriptors.standard.SuperSpeedDeviceDescriptorCollection(automatic_descriptors=True)
Bases:
DeviceDescriptorCollectionObject that builds a full collection of descriptors related to a given USB3 device.
- BOSDescriptor()
Context manager that allows addition of a Binary Object Store descriptor.
It can be used with a with statement; and yields an BinaryObjectStoreDescriptorEmitter that can be populated:
- with collection.BOSDescriptor() as d:
[snip]
This adds the relevant descriptor, automatically. Note that populating derived fields such as bNumDeviceCaps aren’t necessary; they’ll be populated automatically.
- __init__(automatic_descriptors=True)
- Parameters:
automatic_descriptors – If set or not provided, certian required descriptors will be – be added if none exists.
- __iter__()
Allow iterating over each of our descriptors; yields (index, value, descriptor).
- add_default_bos_descriptor()
Adds a default, empty BOS descriptor.
- usb_protocol.emitters.descriptors.standard.get_string_descriptor(string)
Generates a string descriptor for the relevant string.
usb_protocol.emitters.descriptors.uac1 module
Convenience emitters for USB Audio Class 1 descriptors.
usb_protocol.emitters.descriptors.uac2 module
Convenience emitters for USB Audio Class 2 descriptors.
- class usb_protocol.emitters.descriptors.uac2.ClassSpecificAudioControlInterfaceDescriptorEmitter(collection=None)
Bases:
ComplexDescriptorEmitter- DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
usb_protocol.emitters.descriptors.uac3 module
Convenience emitters for USB Audio Class 3 descriptors.
Module contents
Submodules
usb_protocol.emitters.construct_interop module
Helpers for creating construct-related emitters.
- class usb_protocol.emitters.construct_interop.ConstructEmitter(struct)
Bases:
objectClass that creates a simple emitter based on a construct struct.
For example, if we have a construct format that looks like the following:
MyStruct = struct( "a" / Int8 "b" / Int8 )
We could create and emit an object like follows:
emitter = ConstructEmitter(MyStruct) emitter.a = 0xab emitter.b = 0xcd my_bytes = emitter.emit() # "«Í"
- __getattr__(name)
Retrieves an emitter field, if possible.
- __init__(struct)
- Parameters:
construct_format – The format for which to create an emitter.
- __setattr__(name, value)
Hook that we used to set our fields.
- emit()
Emits the stream of bytes associated with this object.
- class usb_protocol.emitters.construct_interop.ConstructEmitterTest(methodName='runTest')
Bases:
TestCase- test_simple_emitter()
- usb_protocol.emitters.construct_interop.emitter_for_format(construct_format)
Creates a factory method for the relevant construct format.
usb_protocol.emitters.descriptor module
- class usb_protocol.emitters.descriptor.ComplexDescriptorEmitter(collection=None)
Bases:
ConstructEmitterBase class for emitting complex descriptors, which contain nested subordinates.
- DESCRIPTOR_FORMAT: DescriptorFormat
- __init__(collection=None)
- Parameters:
collection – If this descriptor belongs to a collection, it should be – provided here. Using a collection object allows e.g. automatic assignment of string descriptor indices.
- add_subordinate_descriptor(subordinate)
Adds a subordinate descriptor to the relevant descriptor.
- Parameter:
- subordinate – The subordinate descriptor to add; can be an emitter,
or a bytes-like object.
- emit(include_subordinates=True)
Emit our descriptor.
- Parameters:
include_subordinates – If true or not provided, any subordinate descriptors will be included.
Module contents
USB-related emitters.
usb_protocol.types package
Subpackages
usb_protocol.types.descriptors package
Subpackages
Submodules
usb_protocol.types.descriptors.cdc module
Structures describing Communications Device Class descriptors.
- class usb_protocol.types.descriptors.cdc.CDCDescriptorNumbers(*values)
Bases:
IntEnum- CS_ENDPOINT = 37
- CS_INTERFACE = 36
- class usb_protocol.types.descriptors.cdc.CDCDescriptorSubtypes(*values)
Bases:
IntEnumNumbers of the Communications Class descriptor subtypes.
- ABSTRACT_CONTROL_MANAGEMENT_FUNCTIONAL = 2
- ATM_NETWORKING_FUNCTIONAL = 16
- CALL_MANAGEMENT_FUNCTIONAL = 1
- CAPI_CONTROL_MANAGEMENT_FUNCTIONAL = 14
- COMMAND_SET_DETAIL_FUNCTIONAL = 23
- COMMAND_SET_FUCNTIONAL = 22
- COUNTRY_SELECTION_FUNCTIONAL = 7
- DEVICE_MANAGEMENT_MODEL_FUNCTIONAL = 20
- DIRECT_LINE_MANAGEMENT_FUNCTIONAL = 3
- ETHERNET_NETWORKING_FUNCTIONAL = 15
- EXTENSION_UNIT_FUNCTIONAL = 12
- HEADER = 0
- MDLM_DETAIL_FUNCTIONAL = 19
- MOBILE_DIRECT_LINE_MODEL_FUNCTIONAL = 18
- MULTI_CHANNEL_MANAGEMENT_FUNCTIONAL = 13
- NCM_FUNCTIONAL = 26
- NETWORK_CHANNEL_TERMINAL = 10
- OBEX_FUNCTIONAL = 21
- OBEX_SERVICE_IDENTIFIER_FUNCTIONAL = 25
- PROTOCOL_UNIT_FUNCTIONAL = 11
- TELEPHONE_CALL_AND_LINE_STATE_FUNCTIONAL = 5
- TELEPHONE_CONTROL_MODEL_FUNCTIONAL = 24
- TELEPHONE_OPERATIONAL_MODES_FUNCTIONAL = 8
- TELEPHONE_RINGER_FUNCTIONAL = 4
- UNION_FUNCTIONAL_DESCRIPTOR = 6
- USB_TERMINAL_FUNCTIONAL = 9
- WIRELESS_HANDSET_CONTROL_MODEL_FUNCTIONAL = 17
usb_protocol.types.descriptors.microsoft10 module
Structures describing Microsoft OS 1.0 Descriptors.
- class usb_protocol.types.descriptors.microsoft10.RegistryTypes(*values)
Bases:
IntEnumStandard Windows registry data types, used in the extended properties descriptor
- REG_BINARY = 3
- REG_DWORD_BIG_ENDIAN = 5
- REG_DWORD_LITTLE_ENDIAN = 4
- REG_EXPAND_SZ = 2
- REG_LINK = 6
- REG_MULTI_SZ = 7
- REG_SZ = 1
usb_protocol.types.descriptors.midi1 module
Descriptors for USB MIDI Class Devices
[Midi10] refers to “Universal Serial Bus Device Class Definition for MIDI Devices”, Release 1.0, November 1, 1999
- class usb_protocol.types.descriptors.midi1.MidiStreamingEndpointDescriptorSubtypes(*values)
Bases:
IntEnum- DESCRIPTOR_UNDEFINED = 0
- MS_GENERAL = 1
usb_protocol.types.descriptors.midi2 module
Descriptors for USB MIDI Class Devices
[Midi20] refers to “Universal Serial Bus Device Class Definition for MIDI Devices”, Release 2.0, May 5, 2020
- class usb_protocol.types.descriptors.midi2.MidiStreamingEndpointDescriptorSubtypes(*values)
Bases:
IntEnum- DESCRIPTOR_UNDEFINED = 0
- MS_GENERAL = 1
- MS_GENERAL_2_0 = 2
- class usb_protocol.types.descriptors.midi2.MidiStreamingInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- ELEMENT = 4
- MIDI_IN_JACK = 2
- MIDI_OUT_JACK = 3
- MS_DESCRIPTOR_UNDEFINED = 0
- MS_HEADER = 1
- class usb_protocol.types.descriptors.midi2.MidiStreamingInterfaceDescriptorTypes(*values)
Bases:
IntEnum- CS_CONFIGURATION = 34
- CS_DEVICE = 33
- CS_ENDPOINT = 37
- CS_GR_TRM_BLOCK = 38
- CS_INTERFACE = 36
- CS_STRING = 35
- CS_UNDEFINED = 32
usb_protocol.types.descriptors.standard module
Structures describing standard USB descriptors. Versions that support parsing incomplete binary data are available as DescriptorType.Partial, e.g. DeviceDescriptor.Partial, and are collectively available in the usb_protocol.types.descriptors.partial.standard module (which, like the structs in this module, can also be imported without .standard).
- class usb_protocol.types.descriptors.standard.DescriptorParserCases(methodName='runTest')
Bases:
TestCase- STRING_DESCRIPTOR = b'(\x03G\x00r\x00e\x00a\x00t\x00 \x00S\x00c\x00o\x00t\x00t\x00 \x00G\x00a\x00d\x00g\x00e\x00t\x00s\x00'
- test_bcd_constructor()
- test_device_descriptor()
- test_string_descriptor_build()
- test_string_descriptor_parse()
- test_string_language_descriptor_build()
- class usb_protocol.types.descriptors.standard.DeviceCapabilityTypes(*values)
Bases:
IntEnumNumbers for the SuperSpeed standard Device Capabilities.
- AUTHENTICATION = 14
- BATTERY_INFO_CAPABILITY = 7
- BILLBOARD = 13
- BILLBOARD_EXTENSION = 15
- CONFIGURATION_SUMMARY = 16
- CONTAINER_ID = 4
- PD_CONSUMER_PORT_CAPABILITY = 8
- PD_PROVIDER_PORT_CAPABILITY = 9
- PLATFORM = 5
- POWER_DELIVERY_CAPABILITY = 6
- PRECISION_TIME_MEASUREMENT = 11
- SUPERSPEED_PLUS = 10
- SUPERSPEED_USB = 3
- USB_2_EXTENSION = 2
- WIRELESS_USB = 1
- WIRELESS_USB_EXTENSION = 12
- class usb_protocol.types.descriptors.standard.StandardDescriptorNumbers(*values)
Bases:
IntEnumNumbers of our standard descriptors.
- BOS = 15
- CONFIGURATION = 2
- DEBUG = 10
- DEVICE = 1
- DEVICE_CAPABILITY = 16
- DEVICE_QUALIFIER = 6
- ENDPOINT = 5
- INTERFACE = 4
- INTERFACE_ASSOCIATION = 11
- INTERFACE_POWER = 8
- OTG = 9
- OTHER_SPEED = 7
- OTHER_SPEED_DESCRIPTOR = 7
- STRING = 3
- SUPERSPEEDPLUS_ISOCHRONOUS_ENDPOINT_COMPANION = 49
- SUPERSPEED_USB_ENDPOINT_COMPANION = 48
usb_protocol.types.descriptors.test_uac2 module
Unit tests for USB Audio Class Devices (UAC), Release 2
- class usb_protocol.types.descriptors.test_uac2.UAC2Cases(methodName='runTest')
Bases:
TestCase- test_build_audio_streaming_interface_descriptor()
- test_build_class_specific_audio_streaming_interface_descriptor()
- test_build_class_specific_audio_streaming_isochronous_audio_data_endpoint_descriptor()
- test_build_clock_source_descriptor()
- test_build_extended_type_i_format_type_descriptor()
- test_build_extended_type_ii_format_type_descriptor()
- test_build_extended_type_iii_format_type_descriptor()
- test_build_feature_unit_descriptor()
- test_build_input_terminal_descriptor()
- test_build_interface_association_descriptor()
- test_build_output_terminal_descriptor()
- test_build_standard_audio_control_interface_descriptor()
- test_build_type_i_format_type_descriptor()
- test_build_type_ii_format_type_descriptor()
- test_build_type_iii_format_type_descriptor()
- test_parse_audio_streaming_interface_descriptor()
- test_parse_class_specific_audio_streaming_interface_descriptor()
- test_parse_class_specific_audio_streaming_isochronous_audio_data_endpoint_descriptor()
- test_parse_clock_source_descriptor()
- test_parse_extended_type_i_format_type_descriptor()
- test_parse_extended_type_ii_format_type_descriptor()
- test_parse_extended_type_iii_format_type_descriptor()
- test_parse_feature_unit_descriptor()
- test_parse_input_terminal_descriptor()
- test_parse_interface_association_descriptor()
- test_parse_output_terminal_descriptor()
- test_parse_standard_audio_control_interface_descriptor()
- test_parse_type_i_format_type_descriptor()
- test_parse_type_ii_format_type_descriptor()
- test_parse_type_iii_format_type_descriptor()
usb_protocol.types.descriptors.uac1 module
Descriptors for USB Audio Class Devices (UAC), Release 1
[Audio10] refers to “Universal Serial Bus Device Class Definition for Audio Devices”, Release 1.0, March 18, 1998 [Frmts10] refers to “Universal Serial Bus Device Class Definition for Audio Data Formats”, Release 1.0, March 18, 1998 [TermT10] refers to “Universal Serial Bus Device Class Definition for Terminal Types”, Release 1.0, March 18, 1998
- class usb_protocol.types.descriptors.uac1.AudioClassSpecificACInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- AC_DESCRIPTOR_UNDEFINED = 0
- EXTENSION_UNIT = 8
- FEATURE_UNIT = 6
- HEADER = 1
- INPUT_TERMINAL = 2
- MIXER_UNIT = 4
- OUTPUT_TERMINAL = 3
- PROCESSING_UNIT = 7
- SELECTOR_UNIT = 5
- class usb_protocol.types.descriptors.uac1.AudioClassSpecificASInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- AS_DESCRIPTOR_UNDEFINED = 0
- AS_GENERAL = 1
- FORMAT_SPECIFIC = 3
- FORMAT_TYPE = 2
- class usb_protocol.types.descriptors.uac1.AudioClassSpecificDescriptorTypes(*values)
Bases:
IntEnum- CS_CONFIGURATION = 34
- CS_DEVICE = 33
- CS_ENDPOINT = 37
- CS_INTERFACE = 36
- CS_STRING = 35
- CS_UNDEFINED = 32
- class usb_protocol.types.descriptors.uac1.AudioClassSpecificEndpointDescriptorSubtypes(*values)
Bases:
IntEnum- DESCRIPTOR_UNDEFINED = 0
- EP_GENERAL = 1
- class usb_protocol.types.descriptors.uac1.AudioClassSpecificRequestCodes(*values)
Bases:
IntEnum- GET_CUR = 129
- GET_MAX = 131
- GET_MEM = 133
- GET_MIN = 130
- GET_RES = 132
- GET_STAT = 255
- REQUEST_CODE_UNDEFINED = 0
- SET_CUR = 1
- SET_MAX = 3
- SET_MEM = 5
- SET_MIN = 2
- SET_RES = 4
- class usb_protocol.types.descriptors.uac1.AudioInterfaceClassCodes(*values)
Bases:
IntEnum- AUDIO = 1
- class usb_protocol.types.descriptors.uac1.AudioInterfaceProtocolCodes(*values)
Bases:
IntEnum- PR_PROTOCOL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac1.AudioInterfaceSubclassCodes(*values)
Bases:
IntEnum- AUDIO_CONTROL = 1
- AUDIO_STREAMING = 2
- INTERFACE_SUBCLASS_UNDEFINED = 0
- MIDI_STREAMING = 3
- class usb_protocol.types.descriptors.uac1.BidirectionalTerminalTypes(*values)
Bases:
IntEnum- BIDIRECTIONAL_UNDEFINED = 1024
- ECHO_CANCELING_SPEAKERPHONE = 1029
- ECHO_SUPPRESSING_SPEAKERPHONE = 1028
- HANDSET = 1025
- HEADSET = 1026
- class usb_protocol.types.descriptors.uac1.ChorusProcessingUnitControlSelectors(*values)
Bases:
IntEnum- CHORUS_DEPTH_CONTROL = 4
- CHORUS_LEVEL_CONTROL = 2
- CHORUS_RATE_CONTROL = 3
- CH_CONTROL_UNDEFINED = 0
- CH_ENABLE_CONTROL = 1
- class usb_protocol.types.descriptors.uac1.DolbyProLogicProcessingUnitControlSelectors(*values)
Bases:
IntEnum- DP_CONTROL_UNDEFINED = 0
- DP_ENABLE_CONTROL = 1
- DP_MODE_SELECT_CONTROL = 2
- class usb_protocol.types.descriptors.uac1.DynamicRangeCompressorProcessingUnitControlSelectors(*values)
Bases:
IntEnum- ATTACK_TIME = 5
- COMPRESSION_RATE_CONTROL = 2
- DR_CONTROL_UNDEFINED = 0
- DR_ENABLE_CONTROL = 1
- MAXAMPL_CONTROL = 3
- RELEASE_TIME = 6
- THRESHOLD_CONTROL = 4
- class usb_protocol.types.descriptors.uac1.EmbeddedFunctionTerminalTypes(*values)
Bases:
IntEnum- ANALOG_TAPE = 1799
- CABLE_TUNER_AUDIO = 1806
- CD_PLAYER = 1795
- DAT = 1796
- DCC = 1797
- DSS_AUDIO = 1807
- DVD_AUDIO = 1803
- EMBEDDED_UNDEFINED = 1792
- EQUALIZATION_NOISE = 1794
- MULTI_TRACK_RECORDER = 1810
- PHONOGRAPH = 1800
- RADIO_RECEIVER = 1808
- RADIO_TRANSMITTER = 1809
- SATELLITE_RECEIVER_AUDIO = 1805
- SYNTHESIZER = 1811
- TV_TUNER_AUDIO = 1804
- VCR_AUDIO = 1801
- VIDEO_DISC_AUDIO = 1802
- class usb_protocol.types.descriptors.uac1.EndpointsControlSelectors(*values)
Bases:
IntEnum- EP_CONTROL_UNDEFINED = 0
- PITCH_CONTROL = 2
- SAMPLING_FREQ_CONTROL = 1
- class usb_protocol.types.descriptors.uac1.ExtensionUnitControlSelectors(*values)
Bases:
IntEnum- XU_CONTROL_UNDEFINED = 0
- XU_ENABLE_CONTROL = 1
- class usb_protocol.types.descriptors.uac1.ExternalTerminalTypes(*values)
Bases:
IntEnum- ANALOG_CONNECTOR = 1537
- DIGITAL_AUDIO_INTERFACE = 1538
- EXTERNAL_UNDEFINED = 1536
- IEEE_1394_DA_STREAM = 1542
- IEEE_1394_DV_STREAM_SOUNDTRACK = 1543
- LINE_CONNECTOR = 1539
- SPDIF_INTERFACE = 1541
- class usb_protocol.types.descriptors.uac1.FeatureUnitControlSelectors(*values)
Bases:
IntEnum- AUTOMATIC_GAIN_CONTROL = 7
- BASS_BOOST_CONTROL = 9
- BASS_CONTROL = 3
- DELAY_CONTROL = 8
- FU_CONTROL_UNDEFINED = 0
- GRAPHIC_EQUALIZER_CONTROL = 6
- LOUDNESS_CONTROL = 10
- MID_CONTROL = 4
- MUTE_CONTROL = 1
- TREBLE_CONTROL = 5
- VOLUME_CONTROL = 2
- class usb_protocol.types.descriptors.uac1.InputTerminalTypes(*values)
Bases:
IntEnum- DESKTOP_MICROPHONE = 514
- INPUT_UNDEFINED = 512
- MICROPHONE = 513
- MICROPHONE_ARRAY = 517
- OMNI_DIRECTIONAL_MICROPHONE = 516
- PERSONAL_MICROPHONE = 515
- PROCESSING_MICROPHONE_ARRAY = 518
- class usb_protocol.types.descriptors.uac1.OutputTerminalTypes(*values)
Bases:
IntEnum- COMMUNICATION_SPEAKER = 774
- DESKTOP_SPEAKER = 772
- HEADPHONES = 770
- LOW_FREQUENCY_EFFECTS_SPEAKER = 775
- OUTPUT_UNDEFINED = 768
- ROOM_SPEAKER = 773
- SPEAKER = 769
- class usb_protocol.types.descriptors.uac1.ProcessingUnitProcessTypes(*values)
Bases:
IntEnum- CHORUS_PROCESS = 5
- DOLBY_PROLOGIC_PROCESS = 2
- DYN_RANGE_COMP_PROCESS = 6
- PROCESS_UNDEFINED = 0
- REVERBERATION_PROCESS = 4
- UP_DOWNMIX_PROCESS = 1
- class usb_protocol.types.descriptors.uac1.ReverberationProcessingUnitControlSelectors(*values)
Bases:
IntEnum- REVERB_FEEDBACK_CONTROL = 4
- REVERB_LEVEL_CONTROL = 2
- REVERB_TIME_CONTROL = 3
- RV_CONTROL_UNDEFINED = 0
- RV_ENABLE_CONTROL = 1
- class usb_protocol.types.descriptors.uac1.TelephonyTerminalTypes(*values)
Bases:
IntEnum- DOWN_LINE_PHONE = 1283
- PHONE_LINE = 1281
- TELEPHONE = 1282
- TELEPHONY_UNDEFINED = 1280
- class usb_protocol.types.descriptors.uac1.TerminalControlSelectors(*values)
Bases:
IntEnum- COPY_PROTECT_CONTROL = 1
- TE_CONTROL_UNDEFINED = 0
usb_protocol.types.descriptors.uac2 module
Descriptors for USB Audio Class Devices (UAC), Release 2
[Audio20] refers to “Universal Serial Bus Device Class Definition for Audio Devices”, Release 2.0, May 31, 2006 [Frmts20] refers to “Universal Serial Bus Device Class Definition for Audio Data Formats”, Release 2.0, May 31, 2006 [TermT20] refers to “Universal Serial Bus Device Class Definition for Terminal Types”, Release 2.0, May 31, 2006
NOTE: This is not complete yet and will be extended as needed
- class usb_protocol.types.descriptors.uac2.AudioClassSpecificACInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- AC_DESCRIPTOR_UNDEFINED = 0
- CLOCK_MULTIPLIER = 12
- CLOCK_SELECTOR = 11
- CLOCK_SOURCE = 10
- EFFECT_UNIT = 7
- EXTENSION_UNIT = 9
- FEATURE_UNIT = 6
- HEADER = 1
- INPUT_TERMINAL = 2
- MIXER_UNIT = 4
- OUTPUT_TERMINAL = 3
- PROCESSING_UNIT = 8
- SAMPLE_RATE_CONVERTER = 13
- SELECTOR_UNIT = 5
- class usb_protocol.types.descriptors.uac2.AudioClassSpecificASInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- AS_DESCRIPTOR_UNDEFINED = 0
- AS_GENERAL = 1
- DECODER = 4
- ENCODER = 3
- FORMAT_TYPE = 2
- class usb_protocol.types.descriptors.uac2.AudioClassSpecificEndpointDescriptorSubtypes(*values)
Bases:
IntEnum- DESCRIPTOR_UNDEFINED = 0
- EP_GENERAL = 1
- class usb_protocol.types.descriptors.uac2.AudioClassSpecificRequestCodes(*values)
Bases:
IntEnum- CUR = 1
- MEM = 3
- RANGE = 2
- REQUEST_CODE_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.AudioClassSpecificStandardDescriptorNumbers(*values)
Bases:
IntEnum- CS_CONFIGURATION = 34
- CS_DEVICE = 33
- CS_ENDPOINT = 37
- CS_INTERFACE = 36
- CS_STRING = 35
- CS_UNDEFINED = 32
- class usb_protocol.types.descriptors.uac2.AudioFunctionCategoryCodes(*values)
Bases:
IntEnum- AUDIO_VIDEO = 11
- CONTROL_PANEL = 12
- CONVERTER = 6
- DESKTOP_SPEAKER = 1
- FUNCTION_SUBCLASS_UNDEFINED = 0
- HEADSET = 4
- HOME_THEATER = 2
- IO_BOX = 8
- MICROPHONE = 3
- MUSICAL_INSTRUMENT = 9
- OTHER = 255
- PRO_AUDIO = 10
- TELEPHONE = 5
- VOICE_SOUND_RECORDER = 7
- class usb_protocol.types.descriptors.uac2.AudioFunctionClassCodes(*values)
Bases:
IntEnum- AUDIO_FUNCTION = 1
- class usb_protocol.types.descriptors.uac2.AudioFunctionProtocolCodes(*values)
Bases:
IntEnum- AF_VERSION_02_00 = 32
- FUNCTION_PROTOCOL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.AudioFunctionSubclassCodes(*values)
Bases:
IntEnum- FUNCTION_SUBCLASS_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.AudioInterfaceClassCodes(*values)
Bases:
IntEnum- AUDIO = 1
- class usb_protocol.types.descriptors.uac2.AudioInterfaceProtocolCodes(*values)
Bases:
IntEnum- INTERFACE_PROTOCOL_UNDEFINED = 0
- IP_VERSION_02_00 = 32
- class usb_protocol.types.descriptors.uac2.AudioInterfaceSubclassCodes(*values)
Bases:
IntEnum- AUDIO_CONTROL = 1
- AUDIO_STREAMING = 2
- INTERFACE_SUBCLASS_UNDEFINED = 0
- MIDI_STREAMING = 3
- class usb_protocol.types.descriptors.uac2.AudioStreamingInterfaceControlSelectors(*values)
Bases:
IntEnum- AS_ACT_ALT_SETTING_CONTROL = 1
- AS_AUDIO_DATA_FORMAT_CONTROL = 3
- AS_CONTROL_UNDEFINED = 0
- AS_VAL_ALT_SETTINGS_CONTROL = 2
- class usb_protocol.types.descriptors.uac2.BidirectionalTerminalTypes(*values)
Bases:
IntEnum- BIDIRECTIONAL_UNDEFINED = 1024
- ECHO_CANCELING_SPEAKERPHONE = 1029
- ECHO_SUPPRESSING_SPEAKERPHONE = 1028
- HANDSET = 1025
- HEADSET = 1026
- class usb_protocol.types.descriptors.uac2.ClockAttributes(*values)
Bases:
IntEnum- EXTERNAL_CLOCK = 0
- INTERNAL_FIXED_CLOCK = 1
- INTERNAL_PROGRAMMABLE_CLOCK = 3
- INTERNAL_VARIABLE_CLOCK = 2
- class usb_protocol.types.descriptors.uac2.ClockFrequencyControl(*values)
Bases:
IntEnum- HOST_PROGRAMMABLE = 3
- HOST_READ_ONLY = 1
- NOT_PRESENT = 0
- class usb_protocol.types.descriptors.uac2.ClockMultiplierControlSelectors(*values)
Bases:
IntEnum- CM_CONTROL_UNDEFINED = 0
- CM_DENOMINATOR_CONTROL = 2
- CM_NUMERATOR_CONTROL = 1
- class usb_protocol.types.descriptors.uac2.ClockSelectorControlSelectors(*values)
Bases:
IntEnum- CX_CLOCK_SELECTOR_CONTROL = 1
- CX_CONTROL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.ClockSourceControlSelectors(*values)
Bases:
IntEnum- CS_CLOCK_VALID_CONTROL = 2
- CS_CONTROL_UNDEFINED = 0
- CS_SAM_FREQ_CONTROL = 1
- class usb_protocol.types.descriptors.uac2.ClusterControl(*values)
Bases:
IntEnum- HOST_PROGRAMMABLE = 192
- HOST_READ_ONLY = 128
- NOT_PRESENT = 0
- class usb_protocol.types.descriptors.uac2.ConnectorControl(*values)
Bases:
IntEnum- HOST_PROGRAMMABLE = 12
- HOST_READ_ONLY = 8
- NOT_PRESENT = 0
- class usb_protocol.types.descriptors.uac2.CopyProtectControl(*values)
Bases:
IntEnum- HOST_PROGRAMMABLE = 3
- HOST_READ_ONLY = 2
- NOT_PRESENT = 0
- class usb_protocol.types.descriptors.uac2.DolbyProLogicProcessingUnitControlSelectors(*values)
Bases:
IntEnum- DP_CLUSTER_CONTROL = 3
- DP_CONTROL_UNDEFINED = 0
- DP_ENABLE_CONTROL = 1
- DP_LATENCY_CONTROL = 6
- DP_MODE_SELECT_CONTROL = 2
- DP_OVERFLOW_CONTROL = 5
- DP_UNDERFLOW_CONTROL = 4
- class usb_protocol.types.descriptors.uac2.DynamicRangeCompressorEffectUnitControlSelectors(*values)
Bases:
IntEnum- DR_ATTACK_TIME_CONTROL = 5
- DR_COMPRESSION_RATE_CONTROL = 2
- DR_CONTROL_UNDEFINED = 0
- DR_ENABLE_CONTROL = 1
- DR_LATENCY_CONTROL = 9
- DR_MAXAMPL_CONTROL = 3
- DR_OVERFLOW_CONTROL = 8
- DR_RELEASE_TIME_CONTROL = 6
- DR_THRESHOLD_CONTROL = 4
- DR_UNDERFLOW_CONTROL = 7
- class usb_protocol.types.descriptors.uac2.EffectUnitEffectTypes(*values)
Bases:
IntEnum- DYN_RANGE_COMP_EFFECT = 4
- EFFECT_UNDEFINED = 0
- MOD_DELAY_EFFECT = 3
- PARAM_EQ_SECTION_EFFECT = 1
- REVERBERATION_EFFECT = 2
- class usb_protocol.types.descriptors.uac2.EmbeddedFunctionTerminalTypes(*values)
Bases:
IntEnum- ANALOG_TAPE = 1799
- CABLE_TUNER_AUDIO = 1806
- CD_PLAYER = 1795
- DAT = 1796
- DCC = 1797
- DRUMS_RHYTHM = 1814
- DSS_AUDIO = 1807
- DVD_AUDIO = 1803
- EMBEDDED_UNDEFINED = 1792
- EQUALIZATION_NOISE = 1794
- GUITAR = 1813
- MULTI_TRACK_RECORDER = 1810
- OTHER_MUSICAL_INSTRUMENT = 1815
- PHONOGRAPH = 1800
- PIANO = 1812
- RADIO_RECEIVER = 1808
- RADIO_TRANSMITTER = 1809
- SATELLITE_RECEIVER_AUDIO = 1805
- SYNTHESIZER = 1811
- TV_TUNER_AUDIO = 1804
- VCR_AUDIO = 1801
- VIDEO_DISC_AUDIO = 1802
- class usb_protocol.types.descriptors.uac2.EndpointControlSelectors(*values)
Bases:
IntEnum- EN_BIT_RATE_CONTROL = 1
- EN_ENCODER_ERROR_CONTROL = 7
- EN_OVERFLOW_CONTROL = 6
- EN_PARAM1_CONTROL = 8
- EN_PARAM2_CONTROL = 9
- EN_PARAM3_CONTROL = 10
- EN_PARAM4_CONTROL = 11
- EN_PARAM5_CONTROL = 12
- EN_PARAM6_CONTROL = 13
- EN_PARAM7_CONTROL = 14
- EN_PARAM8_CONTROL = 15
- EN_QUALITY_CONTROL = 2
- EN_TYPE_CONTROL = 4
- EN_UNDERFLOW_CONTROL = 5
- EN_VBR_CONTROL = 3
- EP_CONTROL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.ExtensionUnitControlSelectors(*values)
Bases:
IntEnum- XU_CLUSTER_CONTROL = 2
- XU_CONTROL_UNDEFINED = 0
- XU_ENABLE_CONTROL = 1
- XU_LATENCY_CONTROL = 5
- XU_OVERFLOW_CONTROL = 4
- XU_UNDERFLOW_CONTROL = 3
- class usb_protocol.types.descriptors.uac2.ExternalTerminalTypes(*values)
Bases:
IntEnum- ADAT_LIGHTPIPE = 1544
- ANALOG_CONNECTOR = 1537
- DIGITAL_AUDIO_INTERFACE = 1538
- EXTERNAL_UNDEFINED = 1536
- IEEE_1394_DA_STREAM = 1542
- IEEE_1394_DV_STREAM_SOUNDTRACK = 1543
- LINE_CONNECTOR = 1539
- MADI = 1546
- SPDIF_INTERFACE = 1541
- TDIF = 1545
- class usb_protocol.types.descriptors.uac2.FeatureUnitControlSelectors(*values)
Bases:
IntEnum- FU_AUTOMATIC_GAIN_CONTROL = 7
- FU_BASS_BOOST_CONTROL = 9
- FU_BASS_CONTROL = 3
- FU_CONTROL_UNDEFINED = 0
- FU_DELAY_CONTROL = 8
- FU_GRAPHIC_EQUALIZER_CONTROL = 6
- FU_INPUT_GAIN_CONTROL = 11
- FU_INPUT_GAIN_PAD_CONTROL = 12
- FU_LATENCY_CONTROL = 16
- FU_LOUDNESS_CONTROL = 10
- FU_MID_CONTROL = 4
- FU_MUTE_CONTROL = 1
- FU_OVERFLOW_CONTROL = 15
- FU_PHASE_INVERTER_CONTROL = 13
- FU_TREBLE_CONTROL = 5
- FU_UNDERFLOW_CONTROL = 14
- FU_VOLUME_CONTROL = 2
- class usb_protocol.types.descriptors.uac2.FormatTypes(*values)
Bases:
IntEnum- EXT_FORMAT_TYPE_I = 129
- EXT_FORMAT_TYPE_II = 130
- EXT_FORMAT_TYPE_III = 131
- FORMAT_TYPE_I = 1
- FORMAT_TYPE_II = 2
- FORMAT_TYPE_III = 3
- FORMAT_TYPE_IV = 4
- FORMAT_TYPE_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.GroupTerminalBlockType(*values)
Bases:
IntEnum- BIDIRECTIONAL = 0
- INPUT_ONLY = 1
- OUTPUT_ONLY = 2
- class usb_protocol.types.descriptors.uac2.GroupTerminalDefaultMidiProtocol(*values)
Bases:
IntEnum- MIDI_1_0_UP_TO_128_BITS = 3
- MIDI_1_0_UP_TO_128_BITS_AND_JRTS = 4
- MIDI_1_0_UP_TO_64_BITS = 1
- MIDI_1_0_UP_TO_64_BITS_AND_JRTS = 2
- MIDI_2_0 = 17
- MIDI_2_0_AND_JRTS = 18
- USE_MIDI_CI = 0
- class usb_protocol.types.descriptors.uac2.GroupTerminalNumber(*values)
Bases:
IntEnum- GROUP_1 = 0
- GROUP_10 = 9
- GROUP_11 = 10
- GROUP_12 = 11
- GROUP_13 = 12
- GROUP_14 = 13
- GROUP_15 = 14
- GROUP_16 = 15
- GROUP_2 = 1
- GROUP_3 = 2
- GROUP_4 = 3
- GROUP_5 = 4
- GROUP_6 = 5
- GROUP_7 = 6
- GROUP_8 = 7
- GROUP_9 = 8
- class usb_protocol.types.descriptors.uac2.InputTerminalTypes(*values)
Bases:
IntEnum- DESKTOP_MICROPHONE = 514
- INPUT_UNDEFINED = 512
- MICROPHONE = 513
- MICROPHONE_ARRAY = 517
- OMNI_DIRECTIONAL_MICROPHONE = 516
- PERSONAL_MICROPHONE = 515
- PROCESSING_MICROPHONE_ARRAY = 518
- class usb_protocol.types.descriptors.uac2.MidiStreamingGroupTerminalBlockDescriptorSubtypes(*values)
Bases:
IntEnum- GR_TRM_BLOCK = 2
- GR_TRM_BLOCK_HEADER = 1
- GR_TRM_BLOCK_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.MixerControlSelectors(*values)
Bases:
IntEnum- MU_CLUSTER_CONTROL = 2
- MU_CONTROL_UNDEFINED = 0
- MU_LATENCY_CONTROL = 5
- MU_MIXER_CONTROL = 1
- MU_OVERFLOW_CONTROL = 4
- MU_UNDERFLOW_CONTROL = 3
- class usb_protocol.types.descriptors.uac2.ModulationDelayEffectUnitControlSelectors(*values)
Bases:
IntEnum- MD_BALANCE_CONTROL = 2
- MD_CONTROL_UNDEFINED = 0
- MD_DEPTH_CONTROL = 4
- MD_ENABLE_CONTROL = 1
- MD_FEEDBACK_CONTROL = 6
- MD_LATENCY_CONTROL = 9
- MD_OVERFLOW_CONTROL = 8
- MD_RATE_CONTROL = 3
- MD_TIME_CONTROL = 5
- MD_UNDERFLOW_CONTROL = 7
- class usb_protocol.types.descriptors.uac2.OutputTerminalTypes(*values)
Bases:
IntEnum- COMMUNICATION_SPEAKER = 774
- DESKTOP_SPEAKER = 772
- HEADPHONES = 770
- LOW_FREQUENCY_EFFECTS_SPEAKER = 775
- OUTPUT_UNDEFINED = 768
- ROOM_SPEAKER = 773
- SPEAKER = 769
- class usb_protocol.types.descriptors.uac2.OverflowControl(*values)
Bases:
IntEnum- HOST_PROGRAMMABLE = 3072
- HOST_READ_ONLY = 2048
- NOT_PRESENT = 0
- class usb_protocol.types.descriptors.uac2.OverloadControl(*values)
Bases:
IntEnum- HOST_PROGRAMMABLE = 48
- HOST_READ_ONLY = 32
- NOT_PRESENT = 0
- class usb_protocol.types.descriptors.uac2.ParametricEqualizerSectionEffectUnitControlSelectors(*values)
Bases:
IntEnum- PE_CENTERFREQ_CONTROL = 2
- PE_CONTROL_UNDEFINED = 0
- PE_ENABLE_CONTROL = 1
- PE_GAIN_CONTROL = 4
- PE_LATENCY_CONTROL = 7
- PE_OVERFLOW_CONTROL = 6
- PE_QFACTOR_CONTROL = 3
- PE_UNDERFLOW_CONTROL = 5
- class usb_protocol.types.descriptors.uac2.ProcessingUnitProcessTypes(*values)
Bases:
IntEnum- DOLBY_PROLOGIC_PROCESS = 2
- PROCESS_UNDEFINED = 0
- STEREO_EXTENDER_PROCESS = 3
- UP_DOWNMIX_PROCESS = 1
- class usb_protocol.types.descriptors.uac2.ReverberationEffectUnitControlSelectors(*values)
Bases:
IntEnum- RV_CONTROL_UNDEFINED = 0
- RV_DENSITY_CONTROL = 7
- RV_ENABLE_CONTROL = 1
- RV_FEEDBACK_CONTROL = 5
- RV_HIFREQ_ROLLOFF_CONTROL = 8
- RV_LATENCY_CONTROL = 11
- RV_LEVEL_CONTROL = 3
- RV_OVERFLOW_CONTROL = 10
- RV_PREDELAY_CONTROL = 6
- RV_TIME_CONTROL = 4
- RV_TYPE_CONTROL = 2
- RV_UNDERFLOW_CONTROL = 9
- class usb_protocol.types.descriptors.uac2.SelectorControlSelectors(*values)
Bases:
IntEnum- SU_CONTROL_UNDEFINED = 0
- SU_LATENCY_CONTROL = 2
- SU_SELECTOR_CONTROL = 1
- class usb_protocol.types.descriptors.uac2.SidebandProtocols(*values)
Bases:
IntEnum- PRES_TIMESTAMP_PROTOCOL = 2
- PROTOCOL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac2.StereoExtenderProcessingUnitControlSelectors(*values)
Bases:
IntEnum- ST_EXT_CONTROL_UNDEFINED = 0
- ST_EXT_ENABLE_CONTROL = 1
- ST_EXT_LATENCY_CONTROL = 5
- ST_EXT_OVERFLOW_CONTROL = 4
- ST_EXT_UNDERFLOW_CONTROL = 3
- class usb_protocol.types.descriptors.uac2.TelephonyTerminalTypes(*values)
Bases:
IntEnum- DOWN_LINE_PHONE = 1283
- PHONE_LINE = 1281
- TELEPHONE = 1282
- TELEPHONY_UNDEFINED = 1280
- class usb_protocol.types.descriptors.uac2.TerminalControlSelectors(*values)
Bases:
IntEnum- TE_CLUSTER_CONTROL = 4
- TE_CONNECTOR_CONTROL = 2
- TE_CONTROL_UNDEFINED = 0
- TE_COPY_PROTECT_CONTROL = 1
- TE_LATENCY_CONTROL = 7
- TE_OVERFLOW_CONTROL = 6
- TE_OVERLOAD_CONTROL = 3
- TE_UNDERFLOW_CONTROL = 5
- class usb_protocol.types.descriptors.uac2.TypeIFormats(*values)
Bases:
IntEnum- ALAW = 8
- IEEE_FLOAT = 4
- MULAW = 16
- PCM = 1
- PCM8 = 2
- TYPE_I_RAW_DATA = 2147483648
- class usb_protocol.types.descriptors.uac2.TypeIIFormats(*values)
Bases:
IntEnum- AC_3 = 2
- DTS = 8
- MPEG = 1
- TYPE_II_RAW_DATA = 2147483648
- WMA = 4
- class usb_protocol.types.descriptors.uac2.TypeIIIFormats(*values)
Bases:
IntEnum- IEC61937_AC_3 = 1
- IEC61937_ATRAC = 1024
- IEC61937_ATRAC2_3 = 2048
- IEC61937_DTS_I = 128
- IEC61937_DTS_II = 256
- IEC61937_DTS_III = 512
- IEC61937_MPEG_1_Layer1 = 2
- IEC61937_MPEG_1_Layer2_3 = 4
- IEC61937_MPEG_2_AAC_ADTS = 16
- IEC61937_MPEG_2_EXT = 8
- IEC61937_MPEG_2_Layer1_LS = 32
- IEC61937_MPEG_2_Layer2_3_LS = 64
- IEC61937_MPEG_2_NOEXT = 4
- TYPE_III_WMA = 4096
- class usb_protocol.types.descriptors.uac2.TypeIVFormats(*values)
Bases:
IntEnum- AC_3 = 64
- ALAW = 8
- IEC60958_PCM = 2097152
- IEC61937_AC_3 = 256
- IEC61937_ATRAC = 262144
- IEC61937_ATRAC2_3 = 524288
- IEC61937_DTS_I = 32768
- IEC61937_DTS_II = 65536
- IEC61937_DTS_III = 131072
- IEC61937_MPEG_1_Layer1 = 512
- IEC61937_MPEG_1_Layer2_3 = 1024
- IEC61937_MPEG_2_AAC_ADTS = 4096
- IEC61937_MPEG_2_EXT = 2048
- IEC61937_MPEG_2_Layer1_LS = 8192
- IEC61937_MPEG_2_Layer2_3_LS = 16384
- IEC61937_MPEG_2_NOEXT = 1024
- IEEE_FLOAT = 4
- MPEG = 32
- MULAW = 16
- PCM = 1
- PCM8 = 2
- TYPE_III_WMA = 1048576
- WMA = 128
- class usb_protocol.types.descriptors.uac2.USBTerminalTypes(*values)
Bases:
IntEnum- USB_STREAMING = 257
- USB_UNDEFINED = 256
- USB_VENDOR_SPECIFIC = 511
usb_protocol.types.descriptors.uac3 module
Descriptors for USB Audio Class Devices (UAC), Release 3
[Audio30] refers to “Universal Serial Bus Device Class Definition for Audio Devices”, Release 3.0, September 22, 2016 [Frmts30] refers to “Universal Serial Bus Device Class Definition for Audio Data Formats”, Release 3.0, September 22, 2016 [TermT30] refers to “Universal Serial Bus Device Class Definition for Terminal Types”, Release 3.0, May 31, 2006
NOTE: This is not complete yet and will be extended as needed
- class usb_protocol.types.descriptors.uac3.AmbisonicComponentOrderingConventionTypes(*values)
Bases:
IntEnum- AMBISONIC_CHANNEL_NUMBER_ACN = 1
- FURSE_MALHAM = 2
- ORD_TYPE_UNDEFINED = 0
- SINGLE_INDEX_DESIGNATION_SID = 3
- class usb_protocol.types.descriptors.uac3.AmbisonicNormalizationTypes(*values)
Bases:
IntEnum- MAX_N = 1
- N2D = 5
- N3D = 3
- NORM_TYPE_UNDEFINED = 0
- SN2D = 4
- SN3D = 2
- class usb_protocol.types.descriptors.uac3.AudioClassSpecificACInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- AC_DESCRIPTOR_UNDEFINED = 0
- CLOCK_MULTIPLIER = 13
- CLOCK_SELECTOR = 12
- CLOCK_SOURCE = 11
- CONNECTORS = 15
- EFFECT_UNIT = 8
- EXTENDED_TERMINAL = 4
- EXTENSION_UNIT = 10
- FEATURE_UNIT = 7
- HEADER = 1
- INPUT_TERMINAL = 2
- MIXER_UNIT = 5
- OUTPUT_TERMINAL = 3
- POWER_DOMAIN = 16
- PROCESSING_UNIT = 9
- SAMPLE_RATE_CONVERTER = 14
- SELECTOR_UNIT = 6
- class usb_protocol.types.descriptors.uac3.AudioClassSpecificASInterfaceDescriptorSubtypes(*values)
Bases:
IntEnum- AS_DESCRIPTOR_UNDEFINED = 0
- AS_GENERAL = 1
- AS_VALID_FREQ_RANGE = 2
- class usb_protocol.types.descriptors.uac3.AudioClassSpecificEndpointDescriptorSubtypes(*values)
Bases:
IntEnum- DESCRIPTOR_UNDEFINED = 0
- EP_GENERAL = 1
- class usb_protocol.types.descriptors.uac3.AudioClassSpecificRequestCodes(*values)
Bases:
IntEnum- CUR = 1
- HIGH_CAPABILITY_DESCRIPTOR = 6
- INTEN = 4
- MEM = 3
- RANGE = 2
- REQUEST_CODE_UNDEFINED = 0
- STRING = 5
- class usb_protocol.types.descriptors.uac3.AudioClassSpecificStandardDescriptorTypes(*values)
Bases:
IntEnum- CS_CLUSTER = 38
- CS_CONFIGURATION = 34
- CS_DEVICE = 33
- CS_ENDPOINT = 37
- CS_INTERFACE = 36
- CS_STRING = 35
- CS_UNDEFINED = 32
- class usb_protocol.types.descriptors.uac3.AudioClassSpecificStringDescriptorSubtypes(*values)
Bases:
IntEnum- SUBTYPE_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac3.AudioControlInterfaceControlSelectors(*values)
Bases:
IntEnum- AC_ACTIVE_INTERFACE_CONTROL = 1
- AC_CONTROL_UNDEFINED = 0
- AC_POWER_DOMAIN_CONTROL = 2
- class usb_protocol.types.descriptors.uac3.AudioDataFormats(*values)
Bases:
IntEnum- AC4 = 2147483648
- AC_3 = 256
- ALAW = 8
- ATRAC = 262144
- ATRAC2_3 = 524288
- DRA = 134217728
- DSD = 32
- DTS_I = 32768
- DTS_II = 65536
- DTS_III = 131072
- DTS_IV = 8388608
- E_AC_3 = 2097152
- IEEE_FLOAT = 4
- MAT = 4194304
- MPEG_1_Layer1 = 512
- MPEG_1_Layer2_3 = 1024
- MPEG_2_AAC_ADTS = 4096
- MPEG_2_EXT = 2048
- MPEG_2_Layer1_LS = 8192
- MPEG_2_Layer2_3_LS = 16384
- MPEG_2_NOEXT = 1024
- MPEG_4_AAC_ELD = 4294967296
- MPEG_4_AAC_LC = 67108864
- MPEG_4_AAC_LC_SURROUND = 536870912
- MPEG_4_HE_AAC = 16777216
- MPEG_4_HE_AAC_SURROUND = 268435456
- MPEG_4_HE_AAC_V2 = 33554432
- MPEG_H_3D_AUDIO = 1073741824
- MULAW = 16
- PCM = 1
- PCM8 = 2
- PCM_IEC60958 = 128
- RAW_DATA = 64
- WMA = 1048576
- class usb_protocol.types.descriptors.uac3.AudioFunctionCategoryCodes(*values)
Bases:
IntEnum- AUDIO_VIDEO = 11
- CONTROL_PANEL = 12
- CONVERTER = 6
- DESKTOP_SPEAKER = 1
- FUNCTION_SUBCLASS_UNDEFINED = 0
- GENERIC_SPEAKER = 14
- HEADPHONE = 13
- HEADSET = 4
- HEADSET_ADAPTER = 15
- HOME_THEATER = 2
- IO_BOX = 8
- MICROPHONE = 3
- MUSICAL_INSTRUMENT = 9
- OTHER = 255
- PRO_AUDIO = 10
- SPEAKERPHONE = 16
- TELEPHONE = 5
- VOICE_SOUND_RECORDER = 7
- class usb_protocol.types.descriptors.uac3.AudioFunctionClassCodes(*values)
Bases:
IntEnum- AUDIO_FUNCTION = 1
- class usb_protocol.types.descriptors.uac3.AudioFunctionProtocolCodes(*values)
Bases:
IntEnum- AF_VERSION_01_00 = 0
- AF_VERSION_02_00 = 32
- AF_VERSION_03_00 = 48
- FUNCTION_PROTOCOL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac3.AudioFunctionSubclassCodes(*values)
Bases:
IntEnum- FULL_ADC_3_0 = 1
- FUNCTION_SUBCLASS_UNDEFINED = 0
- GENERIC_IO = 32
- HEADPHONE = 33
- HEADSET = 36
- HEADSET_ADAPTER = 37
- MICROPHONE = 35
- SPEAKER = 34
- SPEAKERPHONE = 38
- class usb_protocol.types.descriptors.uac3.AudioInterfaceClassCodes(*values)
Bases:
IntEnum- AUDIO = 1
- class usb_protocol.types.descriptors.uac3.AudioInterfaceProtocolCodes(*values)
Bases:
IntEnum- IP_VERSION_01_00 = 0
- IP_VERSION_02_00 = 32
- IP_VERSION_03_00 = 48
- class usb_protocol.types.descriptors.uac3.AudioInterfaceSubclassCodes(*values)
Bases:
IntEnum- AUDIO_CONTROL = 1
- AUDIO_STREAMING = 2
- INTERFACE_SUBCLASS_UNDEFINED = 0
- MIDI_STREAMING = 3
- class usb_protocol.types.descriptors.uac3.AudioStreamingInterfaceControlSelectors(*values)
Bases:
IntEnum- AS_ACT_ALT_SETTING_CONTROL = 1
- AS_AUDIO_DATA_FORMAT_CONTROL = 3
- AS_CONTROL_UNDEFINED = 0
- AS_VAL_ALT_SETTINGS_CONTROL = 2
- class usb_protocol.types.descriptors.uac3.BidirectionalTerminalTypes(*values)
Bases:
IntEnum- BIDIRECTIONAL_UNDEFINED = 1024
- ECHO_CANCELING_SPEAKERPHONE = 1029
- ECHO_SUPPRESSING_SPEAKERPHONE = 1028
- HANDSET = 1025
- HEADSET = 1026
- class usb_protocol.types.descriptors.uac3.ChannelPurposeDefinitions(*values)
Bases:
IntEnum- AMBIENT = 4
- GENERIC_AUDIO = 1
- NON_AUDIO = 255
- PURPOSE_UNDEFINED = 0
- REFERENCE = 5
- SPEECH = 3
- ULTRASONIC = 6
- VIBROKINETIC = 7
- VOICE = 2
- class usb_protocol.types.descriptors.uac3.ClockMultiplierControlSelectors(*values)
Bases:
IntEnum- CM_CONTROL_UNDEFINED = 0
- CM_DENOMINATOR_CONTROL = 2
- CM_NUMERATOR_CONTROL = 1
- class usb_protocol.types.descriptors.uac3.ClockSelectorControlSelectors(*values)
Bases:
IntEnum- CX_CLOCK_SELECTOR_CONTROL = 1
- CX_CONTROL_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac3.ClockSourceControlSelectors(*values)
Bases:
IntEnum- CS_CLOCK_VALID_CONTROL = 2
- CS_CONTROL_UNDEFINED = 0
- CS_SAM_FREQ_CONTROL = 1
- class usb_protocol.types.descriptors.uac3.ClusterDescriptorSegmentTypes(*values)
Bases:
IntEnum- CHANNEL_AMBISONIC = 33
- CHANNEL_DESCRIPTION = 34
- CHANNEL_INFORMATION = 32
- CHANNEL_VENDOR_DEFINED = 254
- CLUSTER_DESCRIPTION = 1
- CLUSTER_VENDOR_DEFINED = 31
- END_SEGMENT = 255
- SEGMENT_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac3.ClusterDescriptorSubtypes(*values)
Bases:
IntEnum- SUBTYPE_UNDEFINED = 0
- class usb_protocol.types.descriptors.uac3.ConnectorTypes(*values)
Bases:
IntEnum- BANANA = 9
- BINDING_POST = 10
- BNC = 8
- DIN = 14
- DP = 24
- D_SUB = 26
- EUROBLOCK = 16
- HDMI = 21
- LIGHTNING = 28
- MINI_DIN = 15
- MINI_DP = 25
- Micro_HDMI = 23
- Mini_HDMI = 22
- OPTICAL_3_5MM_COMBO_CONNECTOR = 6
- PHONE_CONNECTOR_2_5_MM = 1
- PHONE_CONNECTOR_3_5_MM = 2
- PHONE_CONNECTOR_6_35_MM = 3
- RCA = 7
- RJ_11 = 18
- RJ_45 = 19
- SCREW_TYPE = 13
- SPEAKON = 11
- SPRING_CLIP = 12
- THUNDERBOLT = 27
- TOSLINK = 20
- UNDEFINED = 0
- USB_3_0_MICRO_B = 35
- USB_MICRO_AB = 34
- USB_MICRO_B = 33
- USB_MINI_B = 32
- USB_STANDARD_A = 30
- USB_STANDARD_B = 31
- USB_TYPE_C = 17
- WIRELESS = 29
- XLR = 5
- XLR_6_35MM_COMBO_CONNECTOR = 4
- class usb_protocol.types.descriptors.uac3.DynamicRangeCompressorEffectUnitControlSelectors(*values)
Bases:
IntEnum- DR_ATTACK_TIME_CONTROL = 5
- DR_COMPRESSION_RATE_CONTROL = 2
- DR_CONTROL_UNDEFINED = 0
- DR_ENABLE_CONTROL = 1
- DR_LATENCY_CONTROL = 9
- DR_MAXAMPL_CONTROL = 3
- DR_OVERFLOW_CONTROL = 8
- DR_RELEASE_TIME_CONTROL = 6
- DR_THRESHOLD_CONTROL = 4
- DR_UNDERFLOW_CONTROL = 7
- class usb_protocol.types.descriptors.uac3.EffectUnitEffectTypes(*values)
Bases:
IntEnum- DYN_RANGE_COMP_EFFECT = 4
- EFFECT_UNDEFINED = 0
- MOD_DELAY_EFFECT = 3
- PARAM_EQ_SECTION_EFFECT = 1
- REVERBERATION_EFFECT = 2
- class usb_protocol.types.descriptors.uac3.EmbeddedFunctionTerminalTypes(*values)
Bases:
IntEnum- ANALOG_TAPE = 1799
- CABLE_TUNER_AUDIO = 1806
- CD_PLAYER = 1795
- DAT = 1796
- DCC = 1797
- DRUMS_RHYTHM = 1814
- DSS_AUDIO = 1807
- DVD_AUDIO = 1803
- EMBEDDED_UNDEFINED = 1792
- EQUALIZATION_NOISE = 1794
- GUITAR = 1813
- MULTI_TRACK_RECORDER = 1810
- OTHER_MUSICAL_INSTRUMENT = 1815
- PHONOGRAPH = 1800
- PIANO = 1812
- RADIO_RECEIVER = 1808
- RADIO_TRANSMITTER = 1809
- SATELLITE_RECEIVER_AUDIO = 1805
- SYNTHESIZER = 1811
- TV_TUNER_AUDIO = 1804
- VCR_AUDIO = 1801
- VIDEO_DISC_AUDIO = 1802
- class usb_protocol.types.descriptors.uac3.EndpointControlSelectors(*values)
Bases:
IntEnum- EP_CONTROL_UNDEFINED = 0
- EP_DATA_OVERRUN_CONTROL = 2
- EP_DATA_UNDERRUN_CONTROL = 3
- EP_PITCH_CONTROL = 1
- class usb_protocol.types.descriptors.uac3.ExtendedTerminalSegmentTypes(*values)
Bases:
IntEnum- CHANNEL_BANDWIDTH = 32
- CHANNEL_MAGNITUDE_PHASE_RESPONSE = 34
- CHANNEL_MAGNITUDE_RESPONSE = 33
- CHANNEL_POSITION_R_THETA_PHI = 36
- CHANNEL_POSITION_XYZ = 35
- CHANNEL_VENDOR_DEFINED = 254
- END_SEGMENT = 255
- SEGMENT_UNDEFINED = 0
- TERMINAL_VENDOR_DEFINED = 31
- class usb_protocol.types.descriptors.uac3.ExtensionUnitControlSelectors(*values)
Bases:
IntEnum- XU_CONTROL_UNDEFINED = 0
- XU_LATENCY_CONTROL = 3
- XU_OVERFLOW_CONTROL = 2
- XU_UNDERFLOW_CONTROL = 1
- class usb_protocol.types.descriptors.uac3.ExternalTerminalTypes(*values)
Bases:
IntEnum- ADAT_LIGHTPIPE = 1544
- ANALOG_CONNECTOR = 1537
- DIGITAL_AUDIO_INTERFACE = 1538
- EXTERNAL_UNDEFINED = 1536
- IEEE_1394_DA_STREAM = 1542
- IEEE_1394_DV_STREAM_SOUNDTRACK = 1543
- LINE_CONNECTOR = 1539
- MADI = 1546
- SPDIF_INTERFACE = 1541
- TDIF = 1545
- class usb_protocol.types.descriptors.uac3.FeatureUnitControlSelectors(*values)
Bases:
IntEnum- FU_AUTOMATIC_GAIN_CONTROL = 7
- FU_BASS_BOOST_CONTROL = 9
- FU_BASS_CONTROL = 3
- FU_CONTROL_UNDEFINED = 0
- FU_DELAY_CONTROL = 8
- FU_GRAPHIC_EQUALIZER_CONTROL = 6
- FU_INPUT_GAIN_CONTROL = 11
- FU_INPUT_GAIN_PAD_CONTROL = 12
- FU_LATENCY_CONTROL = 16
- FU_LOUDNESS_CONTROL = 10
- FU_MID_CONTROL = 4
- FU_MUTE_CONTROL = 1
- FU_OVERFLOW_CONTROL = 15
- FU_PHASE_INVERTER_CONTROL = 13
- FU_TREBLE_CONTROL = 5
- FU_UNDERFLOW_CONTROL = 14
- FU_VOLUME_CONTROL = 2
- class usb_protocol.types.descriptors.uac3.InputTerminalTypes(*values)
Bases:
IntEnum- DESKTOP_MICROPHONE = 514
- INPUT_UNDEFINED = 512
- MICROPHONE = 513
- MICROPHONE_ARRAY = 517
- OMNI_DIRECTIONAL_MICROPHONE = 516
- PERSONAL_MICROPHONE = 515
- PROCESSING_MICROPHONE_ARRAY = 518
- class usb_protocol.types.descriptors.uac3.MixerControlSelectors(*values)
Bases:
IntEnum- MU_CONTROL_UNDEFINED = 0
- MU_LATENCY_CONTROL = 4
- MU_MIXER_CONTROL = 1
- MU_OVERFLOW_CONTROL = 3
- MU_UNDERFLOW_CONTROL = 2
- class usb_protocol.types.descriptors.uac3.ModulationDelayEffectUnitControlSelectors(*values)
Bases:
IntEnum- MD_BALANCE_CONTROL = 2
- MD_CONTROL_UNDEFINED = 0
- MD_DEPTH_CONTROL = 4
- MD_ENABLE_CONTROL = 1
- MD_FEEDBACK_CONTROL = 6
- MD_LATENCY_CONTROL = 9
- MD_OVERFLOW_CONTROL = 8
- MD_RATE_CONTROL = 3
- MD_TIME_CONTROL = 5
- MD_UNDERFLOW_CONTROL = 7
- class usb_protocol.types.descriptors.uac3.OutputTerminalTypes(*values)
Bases:
IntEnum- COMMUNICATION_SPEAKER = 774
- DESKTOP_SPEAKER = 772
- HEADPHONES = 770
- LOW_FREQUENCY_EFFECTS_SPEAKER = 775
- OUTPUT_UNDEFINED = 768
- ROOM_SPEAKER = 773
- SPEAKER = 769
- class usb_protocol.types.descriptors.uac3.ParametricEqualizerSectionEffectUnitControlSelectors(*values)
Bases:
IntEnum- PE_CENTERFREQ_CONTROL = 2
- PE_CONTROL_UNDEFINED = 0
- PE_ENABLE_CONTROL = 1
- PE_GAIN_CONTROL = 4
- PE_LATENCY_CONTROL = 7
- PE_OVERFLOW_CONTROL = 6
- PE_QFACTOR_CONTROL = 3
- PE_UNDERFLOW_CONTROL = 5
- class usb_protocol.types.descriptors.uac3.ProcessingUnitProcessTypes(*values)
Bases:
IntEnum- MULTI_FUNCTION_PROCESS = 3
- PROCESS_UNDEFINED = 0
- STEREO_EXTENDER_PROCESS = 2
- UP_DOWNMIX_PROCESS = 1
- class usb_protocol.types.descriptors.uac3.ReverberationEffectUnitControlSelectors(*values)
Bases:
IntEnum- RV_CONTROL_UNDEFINED = 0
- RV_DENSITY_CONTROL = 7
- RV_ENABLE_CONTROL = 1
- RV_FEEDBACK_CONTROL = 5
- RV_HIFREQ_ROLLOFF_CONTROL = 8
- RV_LATENCY_CONTROL = 11
- RV_LEVEL_CONTROL = 3
- RV_OVERFLOW_CONTROL = 10
- RV_PREDELAY_CONTROL = 6
- RV_TIME_CONTROL = 4
- RV_TYPE_CONTROL = 2
- RV_UNDERFLOW_CONTROL = 9
- class usb_protocol.types.descriptors.uac3.SelectorControlSelectors(*values)
Bases:
IntEnum- SU_CONTROL_UNDEFINED = 0
- SU_LATENCY_CONTROL = 2
- SU_SELECTOR_CONTROL = 1
- class usb_protocol.types.descriptors.uac3.StereoExtenderProcessingUnitControlSelectors(*values)
Bases:
IntEnum- ST_EXT_CONTROL_UNDEFINED = 0
- ST_EXT_LATENCY_CONTROL = 4
- ST_EXT_OVERFLOW_CONTROL = 3
- ST_EXT_UNDERFLOW_CONTROL = 2
- ST_EXT_WIDTH_CONTROL = 1
- class usb_protocol.types.descriptors.uac3.TelephonyTerminalTypes(*values)
Bases:
IntEnum- DOWN_LINE_PHONE = 1283
- PHONE_LINE = 1281
- TELEPHONE = 1282
- TELEPHONY_UNDEFINED = 1280
- class usb_protocol.types.descriptors.uac3.TerminalControlSelectors(*values)
Bases:
IntEnum- TE_CONTROL_UNDEFINED = 0
- TE_INSERTION_CONTROL = 1
- TE_LATENCY_CONTROL = 5
- TE_OVERFLOW_CONTROL = 4
- TE_OVERLOAD_CONTROL = 2
- TE_UNDERFLOW_CONTROL = 3
Module contents
usb_protocol.types.superspeed package
Module contents
SuperSpeed USB types – defines enumerations that describe standard USB3 types.
- class usb_protocol.types.superspeed.HeaderPacketType(*values)
Bases:
IntEnumConstants representing the Header Packet archetypes.
- DATA = 8
- ISOCHRONOUS_TIMESTAMP = 12
- LINK_MANAGEMENT = 0
- TRANSACTION = 4
- class usb_protocol.types.superspeed.LinkCommand(*values)
Bases:
IntEnumConstant values (including both class and type) for link commands.
- LAU = 5
- LBAD = 3
- LCRD = 1
- LDN = 11
- LGOOD = 0
- LGO_U = 4
- LPMA = 7
- LRTY = 2
- LUP = 8
- LXU = 6
- get_class()
- get_type()
- class usb_protocol.types.superspeed.LinkManagementPacketSubtype(*values)
Bases:
IntEnumConstants represneting the various types of Link Management Packet.
- PORT_CAPABILITY = 4
- PORT_CONFIGURATION = 5
- PORT_CONFIGURATION_RESPONSE = 6
- PRECISION_TIME_MANAGEMENT = 7
- SET_LINK_FUNCTION = 1
- U2_INACTIVITY_TIMEOUT = 2
- VENDOR_DEVICE_TEST = 3
Submodules
usb_protocol.types.descriptor module
Type elements for defining USB descriptors.
- class usb_protocol.types.descriptor.BCDFieldAdapter(subcon)
Bases:
AdapterConstruct adapter that dynamically parses BCD fields.
- class usb_protocol.types.descriptor.DescriptorField(description='', default=None, *, length=None)
Bases:
SubconstructConstruct 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>}
- class usb_protocol.types.descriptor.DescriptorFormat(*subcons, _create_partial=True, **subconskw)
Bases:
StructCreates a Construct structure for a USB descriptor, and a corresponding version that supports parsing incomplete binary as DescriptorType.Partial, e.g. DeviceDescriptor.Partial.
- parse(data, **context_keywords)
Hook on the parent parse() method which attaches a few methods.
Module contents
USB types – defines enumerations that describe standard USB types
- class usb_protocol.types.DescriptorTypes(*values)
Bases:
IntEnum- CONFIGURATION = 2
- DEVICE = 1
- DEVICE_QUALIFIER = 6
- ENDPOINT = 5
- HID = 33
- INTERFACE = 4
- INTERFACE_POWER = 8
- OTHER_SPEED_CONFIGURATION = 7
- REPORT = 34
- STRING = 3
- class usb_protocol.types.LanguageIDs(*values)
Bases:
IntEnum- AFRIKAANS = 1078
- ALBANIAN = 1052
- ARABIC_ALGERIA = 5121
- ARABIC_BAHRAIN = 15361
- ARABIC_EGYPT = 3073
- ARABIC_IRAQ = 2049
- ARABIC_JORDAN = 11265
- ARABIC_KUWAIT = 13313
- ARABIC_LEBANON = 12289
- ARABIC_LIBYA = 4097
- ARABIC_MOROCCO = 6145
- ARABIC_OMAN = 8193
- ARABIC_QATAR = 16385
- ARABIC_SAUDI_ARABIA = 1025
- ARABIC_SYRIA = 10241
- ARABIC_TUNISIA = 7169
- ARABIC_UAE = 14337
- ARABIC_YEMEN = 9217
- ARMENIAN = 1067
- ASSAMESE = 1101
- AZERI_CYRILLIC = 2092
- AZERI_LATIN = 1068
- BASQUE = 1069
- BELARUSSIAN = 1059
- BENGALI = 1093
- BULGARIAN = 1026
- BURMESE = 1109
- CATALAN = 1027
- CHINESE_HONG_KONG = 3076
- CHINESE_MACAU_SAR = 5124
- CHINESE_PRC = 2052
- CHINESE_SINGAPORE = 4100
- CHINESE_TAIWAN = 1028
- CROATIAN = 1050
- CZECH = 1029
- DANISH = 1030
- DUTCH_BELGIUM = 2067
- DUTCH_NETHERLANDS = 1043
- ENGLISH_AUSTRALIAN = 3081
- ENGLISH_BELIZE = 10249
- ENGLISH_CANADIAN = 4105
- ENGLISH_CARIBBEAN = 9225
- ENGLISH_IRELAND = 6153
- ENGLISH_JAMAICA = 8201
- ENGLISH_NEW_ZEALAND = 5129
- ENGLISH_PHILIPPINES = 13321
- ENGLISH_SOUTH_AFRICA = 7177
- ENGLISH_TRINIDAD = 11273
- ENGLISH_UNITED_KINGDOM = 2057
- ENGLISH_US = 1033
- ENGLISH_ZIMBABWE = 12297
- ESTONIAN = 1061
- FAEROESE = 1080
- FARSI = 1065
- FINNISH = 1035
- FRENCH_BELGIAN = 2060
- FRENCH_CANADIAN = 3084
- FRENCH_LUXEMBOURG = 5132
- FRENCH_MONACO = 6156
- FRENCH_STANDARD = 1036
- FRENCH_SWITZERLAND = 4108
- GEORGIAN = 1079
- GERMAN_AUSTRIA = 3079
- GERMAN_LIECHTENSTEIN = 5127
- GERMAN_LUXEMBOURG = 4103
- GERMAN_STANDARD = 1031
- GERMAN_SWITZERLAND = 2055
- GREEK = 1032
- GUJARATI = 1095
- HEBREW = 1037
- HID_USAGE_DATA_DESCRIPTOR = 1279
- HID_VENDOR_DEFINED_1 = 61695
- HID_VENDOR_DEFINED_2 = 62719
- HID_VENDOR_DEFINED_3 = 63743
- HID_VENDOR_DEFINED_4 = 64767
- HINDI = 1081
- HUNGARIAN = 1038
- ICELANDIC = 1039
- INDONESIAN = 1057
- ITALIAN_STANDARD = 1040
- ITALIAN_SWITZERLAND = 2064
- JAPANESE = 1041
- KANNADA = 1099
- KASHMIRI_INDIA = 2144
- KAZAKH = 1087
- KONKANI = 1111
- KOREAN = 1042
- KOREAN_JOHAB = 2066
- LATVIAN = 1062
- LITHUANIAN = 1063
- LITHUANIAN_CLASSIC = 2087
- MACEDONIAN = 1071
- MALAYALAM = 1100
- MALAY_BRUNEI_DARUSSALAM = 2110
- MALAY_MALAYSIAN = 1086
- MANIPURI = 1112
- MARATHI = 1102
- NEPALI_INDIA = 2145
- NORWEGIAN_BOKMAL = 1044
- NORWEGIAN_NYNORSK = 2068
- ORIYA = 1096
- POLISH = 1045
- PORTUGUESE_BRAZIL = 1046
- PORTUGUESE_STANDARD = 2070
- PUNJABI = 1094
- ROMANIAN = 1048
- RUSSIAN = 1049
- SANSKRIT = 1103
- SERBIAN_CYRILLIC = 3098
- SERBIAN_LATIN = 2074
- SINDHI = 1113
- SLOVAK = 1051
- SLOVENIAN = 1060
- SPANISH_ARGENTINA = 11274
- SPANISH_BOLIVIA = 16394
- SPANISH_CHILE = 13322
- SPANISH_COLOMBIA = 9226
- SPANISH_COSTA_RICA = 5130
- SPANISH_DOMINICAN_REPUBLIC = 7178
- SPANISH_ECUADOR = 12298
- SPANISH_EL_SALVADOR = 17418
- SPANISH_GUATEMALA = 4106
- SPANISH_HONDURAS = 18442
- SPANISH_MEXICAN = 2058
- SPANISH_MODERN_SORT = 3082
- SPANISH_NICARAGUA = 19466
- SPANISH_PANAMA = 6154
- SPANISH_PARAGUAY = 15370
- SPANISH_PERU = 10250
- SPANISH_PUERTO_RICO = 20490
- SPANISH_TRADITIONAL_SORT = 1034
- SPANISH_URUGUAY = 14346
- SPANISH_VENEZUELA = 8202
- SUTU = 1072
- SWAHILI_KENYA = 1089
- SWEDISH = 1053
- SWEDISH_FINLAND = 2077
- TAMIL = 1097
- TATAR_TATARSTAN = 1092
- TELUGU = 1098
- THAI = 1054
- TURKISH = 1055
- UKRAINIAN = 1058
- URDU_INDIA = 2080
- URDU_PAKISTAN = 1056
- UZBEK_CYRILLIC = 2115
- UZBEK_LATIN = 1091
- VIETNAMESE = 1066
- class usb_protocol.types.USBDirection(*values)
Bases:
IntEnumClass representing USB directions.
- IN = 1
- OUT = 0
- classmethod from_endpoint_address(address)
Helper method that extracts the direction from an endpoint address.
- classmethod from_request_type(request_type_int)
Helper method that extracts the direction from a request_type integer.
- is_in()
- is_out()
- classmethod parse(value)
Helper that converts a numeric field into a direction.
- reverse()
Returns the reverse of the given direction.
- to_endpoint_address(endpoint_number)
Helper method that converts and endpoint_number to an address, given direction.
- token()
Generates the token corresponding to the given direction.
- class usb_protocol.types.USBPIDCategory(*values)
Bases:
IntFlagCategory constants for each of the groups that PIDs can fall under.
- DATA = 3
- HANDSHAKE = 2
- MASK = 3
- SPECIAL = 0
- TOKEN = 1
- class usb_protocol.types.USBPacketID(*values)
Bases:
IntFlagEnumeration specifying all of the valid USB PIDs we can handle.
- ACK = 2
- DATA0 = 3
- DATA1 = 11
- DATA2 = 7
- ERR = 12
- IN = 9
- MDATA = 15
- NAK = 10
- NYET = 6
- OUT = 1
- PID_CORE_MASK = 15
- PID_INVALID = 16
- PING = 4
- PRE = 12
- SETUP = 13
- SOF = 5
- SPLIT = 8
- STALL = 14
- byte()
Return the PID’s value with its upper nibble.
- category()
Returns the USBPIDCategory that each given PID belongs to.
- direction()
Get a USB direction from a PacketID.
- classmethod from_byte(byte, skip_checks=False)
Creates a PID object from a byte.
- classmethod from_int(value, skip_checks=True)
Create a PID object from an integer.
- classmethod from_name(name)
Create a PID object from a string representation of its name.
- is_data()
Returns true iff the given PID represents a DATA packet.
- is_handshake()
Returns true iff the given PID represents a handshake packet.
- is_invalid()
Returns true if this object is an attempt to encapsulate an invalid PID.
- is_token()
Returns true iff the given PID represents a token packet.
- classmethod parse(value)
Attempt to create a PID object from a number, byte, or string.
- summarize()
Return a summary of the given packet.
- class usb_protocol.types.USBRequestRecipient(*values)
Bases:
IntEnumEnumeration that describes each ‘recipient’ of a USB request field.
- DEVICE = 0
- ENDPOINT = 2
- INTERFACE = 1
- OTHER = 3
- RESERVED = 4
- classmethod from_integer(value)
Special factory that correctly handles reserved values.
- classmethod from_request_type(request_type_int)
Helper method that extracts the type from a request_type integer.
- class usb_protocol.types.USBRequestType(*values)
Bases:
IntEnumEnumeration that describes each possible Type field for a USB request.
- CLASS = 1
- RESERVED = 3
- STANDARD = 0
- VENDOR = 2
- classmethod from_request_type(request_type_int)
Helper method that extracts the type from a request_type integer.
- class usb_protocol.types.USBStandardFeatures(*values)
Bases:
IntEnum- DEVICE_REMOTE_WAKEUP = 1
- ENDPOINT_HALT = 0
- TEST_MODE = 2
- class usb_protocol.types.USBStandardRequests(*values)
Bases:
IntEnum- CLEAR_FEATURE = 1
- GET_CONFIGURATION = 8
- GET_DESCRIPTOR = 6
- GET_ENCRYPTION = 14
- GET_HANDSHAKE = 16
- GET_INTERFACE = 10
- GET_SECURITY_DATA = 19
- GET_STATUS = 0
- LOOPBACK_DATA_READ = 22
- LOOPBACK_DATA_WRITE = 21
- SET_ADDRESS = 5
- SET_CONFIGURATION = 9
- SET_CONNECTION = 17
- SET_DESCRIPTOR = 7
- SET_ENCRYPTION = 13
- SET_FEATURE = 3
- SET_HANDSHAKE = 15
- SET_INTERFACE = 11
- SET_INTERFACE_DS = 23
- SET_ISOCH_DELAY = 49
- SET_SECURITY_DATA = 18
- SET_SEL = 48
- SET_WUSB_DATA = 20
- SYNCH_FRAME = 12
- class usb_protocol.types.USBSynchronizationType(*values)
Bases:
IntEnum- ADAPTIVE = 2
- ASYNC = 1
- NONE = 0
- SYNCHRONOUS = 3
- class usb_protocol.types.USBTransferType(*values)
Bases:
IntEnum- BULK = 2
- CONTROL = 0
- INTERRUPT = 3
- ISOCHRONOUS = 1
- class usb_protocol.types.USBUsageType(*values)
Bases:
IntEnum- DATA = 0
- FEEDBACK = 1
- IMPLICIT_FEEDBACK = 2
- usb_protocol.types.endpoint_number_from_address(number)
Helper function that converts an endpoint address to an endpoint number, discarding direction.