tools/usb_gadget/gadget.py
def GetDescriptor(self, recipient, typ, index, lang, length):
    """Handle a standard GET_DESCRIPTOR request.

    See Universal Serial Bus Specification Revision 2.0 section 9.4.3.

    Args:
      recipient: Request recipient (device, interface, endpoint, etc.)
      typ: Descriptor type.
      index: Descriptor index.
      lang: Descriptor language code.
      length: Maximum amount of data the host expects the device to return.

    Returns:
      The value of the descriptor or None to stall the pipe.
    """
    if typ == usb_constants.DescriptorType.STRING:
      return self.GetStringDescriptor(index, lang, length)
    elif typ == usb_constants.DescriptorType.BOS:
      return self.GetBosDescriptor(length)
Handle a standard GET_DESCRIPTOR request.

    See Universal Serial Bus Specification Revision 2.0 section 9.4.3.

    Args:
      recipient: Request recipient (device, interface, endpoint, etc.)
      typ: Descriptor type.
      index: Descriptor index.
      lang: Descriptor language code.
      length: Maximum amount of data the host expects the device to return.

    Returns:
      The value of the descriptor or None to stall the pipe.
    
Handle a standard GET_DESCRIPTOR request.
Handle a standard GET_DESCRIPTOR request .
def GetDescriptor(self, recipient, typ, index, lang, length):
    if typ == usb_constants.DescriptorType.STRING:
      return self.GetStringDescriptor(index, lang, length)
    elif typ == usb_constants.DescriptorType.BOS:
      return self.GetBosDescriptor(length)
def GetDescriptor ( self , recipient , typ , index , lang , length ) : if typ == usb_constants . DescriptorType . STRING : return self . GetStringDescriptor ( index , lang , length ) elif typ == usb_constants . DescriptorType . BOS : return self . GetBosDescriptor ( length )
Handle a standard GET_DESCRIPTOR request.
Handle a standard GET_DESCRIPTOR request .
"""Handle a standard GET_DESCRIPTOR request.

    See Universal Serial Bus Specification Revision 2.0 section 9.4.3.

    Args:
      recipient: Request recipient (device, interface, endpoint, etc.)
      typ: Descriptor type.
      index: Descriptor index.
      lang: Descriptor language code.
      length: Maximum amount of data the host expects the device to return.

    Returns:
      The value of the descriptor or None to stall the pipe.
    """
The value of the descriptor or None to stall the pipe.
The value of the descriptor or None to stall the pipe .
self
recipient
Request recipient (device, interface, endpoint, etc.)
Request recipient ( device interface endpoint etc . )
typ
None
index
None
lang
Descriptor language code.
Descriptor language code .
length
Maximum amount of data the host expects the device to return.
Maximum amount of data the host expects the device to return .