# 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 docopt import docopt
from binascii import unhexlify, hexlify
from umap2.core.usb import DescriptorType
import struct
            ('descriptors', 'None'),
            ('cs_interfaces', cs_interfaces_name),
            ('usb_class', 'usb_class'),
            ('usb_vendor', 'usb_vendor'),
        ])
        node.list_names = {
            DescriptorType.endpoint: endpoints_name,
            DescriptorType.cs_interface: cs_interfaces_name,
        }
        return s

    @parse_pfn(DescriptorType.configuration)
    def parse_configuration_desc(self, desc, node):
        if len(desc) != 9:
            raise Exception('configuration descriptor length is not 9 bytes')
        (
            _, bDescriptorType, _, _,
            index, string_index, attributes, max_power
        ) = struct.unpack('<BBHBBBBB', desc)
        if bDescriptorType != DescriptorType.configuration:
            raise Exception('This is not a configuration descriptor! %02x' % (bDescriptorType))
        interfaces_name = "config_%s_interfaces" % (index)
        s = build_init('USBConfiguration', [
            ('index', index),
            ('string', "strings_dict.get(%s, 'Config-%s')" % (string_index, string_index)),
            ('interfaces', interfaces_name),
            ('attributes', attributes),
            ('max_power', max_power),
        ])
        node.list_names = {

# 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/utils/dev_generator.py
from docopt import docopt
from binascii import unhexlify, hexlify
from umap2.core.usb import DescriptorType
import struct

            ('descriptors', 'None'),
            ('cs_interfaces', cs_interfaces_name),
            ('usb_class', 'usb_class'),
            ('usb_vendor', 'usb_vendor'),
        ])
        node.list_names = {
            DescriptorType.endpoint: endpoints_name,
            DescriptorType.cs_interface: cs_interfaces_name,
        }
        return s

    @parse_pfn(DescriptorType.configuration)
    def parse_configuration_desc(self, desc, node):
        if len(desc) != 9:
            raise Exception('configuration descriptor length is not 9 bytes')
        (
            _, bDescriptorType, _, _,
            index, string_index, attributes, max_power
        ) = struct.unpack('<BBHBBBBB', desc)
        if bDescriptorType != DescriptorType.configuration:
            raise Exception('This is not a configuration descriptor! %02x' % (bDescriptorType))
        interfaces_name = "config_%s_interfaces" % (index)
        s = build_init('USBConfiguration', [
            ('index', index),
            ('string', "strings_dict.get(%s, 'Config-%s')" % (string_index, string_index)),
            ('interfaces', interfaces_name),
            ('attributes', attributes),
            ('max_power', max_power),
        ])
        node.list_names = {

            DescriptorType.interface: interfaces_name,