# Path: umap2/core/usb.py
# class DescriptorType(object):
#     device = 0x01
#     configuration = 0x02
#     string = 0x03
#     interface = 0x04
#     endpoint = 0x05
#     device_qualifier = 0x06
#     other_speed_configuration = 0x07
#     interface_power = 0x08
#     bos = 0x0f
#     device_capability = 0x10
#     hid = 0x21
#     report = 0x22
#     cs_interface = 0x24
#     cs_endpoint = 0x25
#     hub = 0x29


from umap2.core.usb import DescriptorType
from kitty.model import UInt8, LE16, RandomBytes, BitField, Static
from kitty.model import Template, Repeat, List, Container, ForEach, OneOf
from kitty.model import ElementCount, SizeInBytes
from kitty.model import ENC_INT_LE
from hid import GenerateHidReport
from generic import Descriptor, SizedPt, DynamicInt, SubDescriptor
    name='audio_output_terminal_descriptor',
    descriptor_type=DescriptorType.cs_interface,
    fields=[
        UInt8(name='bDesciptorSubType', value=_AC_DescriptorSubTypes.OUTPUT_TERMINAL),
        UInt8(name='bTerminalID', value=0x00),
        LE16(name='wTerminalType', value=0x0307),  # termt10.pdf table 2-3
        UInt8(name='bAssocTerminal', value=0x00),
        UInt8(name='bSourceID', value=0x01),
        UInt8(name='iTerminal', value=0x00)
    ])

# Table 4-7
# TODO: remove?
audio_feature_unit_descriptor = Descriptor(
    name='audio_feature_unit_descriptor',
    descriptor_type=DescriptorType.cs_interface,
    fields=[
        UInt8(name='bDesciptorSubType', value=_AC_DescriptorSubTypes.FEATURE_UNIT),
        UInt8(name='bUnitID', value=0x00),
        UInt8(name='bSourceID', value=0x00),
        SizedPt(name='bmaControls',
                fields=RandomBytes(name='bmaControlsX', value='\x00', min_length=0, step=17, max_length=249)),
        UInt8(name='iFeature', value=0x00)
    ])


# Table 4-19
# TODO: remove?
audio_as_interface_descriptor = Descriptor(
    name='audio_as_interface_descriptor',

# Path: umap2/core/usb.py
# class DescriptorType(object):
#     device = 0x01
#     configuration = 0x02
#     string = 0x03
#     interface = 0x04
#     endpoint = 0x05
#     device_qualifier = 0x06
#     other_speed_configuration = 0x07
#     interface_power = 0x08
#     bos = 0x0f
#     device_capability = 0x10
#     hid = 0x21
#     report = 0x22
#     cs_interface = 0x24
#     cs_endpoint = 0x25
#     hub = 0x29


# Path: umap2/fuzz/templates/audio.py
from umap2.core.usb import DescriptorType
from kitty.model import UInt8, LE16, RandomBytes, BitField, Static
from kitty.model import Template, Repeat, List, Container, ForEach, OneOf
from kitty.model import ElementCount, SizeInBytes
from kitty.model import ENC_INT_LE
from hid import GenerateHidReport
from generic import Descriptor, SizedPt, DynamicInt, SubDescriptor

    name='audio_output_terminal_descriptor',
    descriptor_type=DescriptorType.cs_interface,
    fields=[
        UInt8(name='bDesciptorSubType', value=_AC_DescriptorSubTypes.OUTPUT_TERMINAL),
        UInt8(name='bTerminalID', value=0x00),
        LE16(name='wTerminalType', value=0x0307),  # termt10.pdf table 2-3
        UInt8(name='bAssocTerminal', value=0x00),
        UInt8(name='bSourceID', value=0x01),
        UInt8(name='iTerminal', value=0x00)
    ])

# Table 4-7
# TODO: remove?
audio_feature_unit_descriptor = Descriptor(
    name='audio_feature_unit_descriptor',
    descriptor_type=DescriptorType.cs_interface,
    fields=[
        UInt8(name='bDesciptorSubType', value=_AC_DescriptorSubTypes.FEATURE_UNIT),
        UInt8(name='bUnitID', value=0x00),
        UInt8(name='bSourceID', value=0x00),
        SizedPt(name='bmaControls',
                fields=RandomBytes(name='bmaControlsX', value='\x00', min_length=0, step=17, max_length=249)),
        UInt8(name='iFeature', value=0x00)
    ])


# Table 4-19
# TODO: remove?
audio_as_interface_descriptor = Descriptor(
    name='audio_as_interface_descriptor',

    descriptor_type=DescriptorType.cs_interface,