tools/usb_gadget/hid_gadget.py
def ReceivePacket(self, endpoint, data):
    """Dispatch a report to the appropriate feature.

    See Device Class Definition for Human Interface Devices (HID) Version 1.11
    section 8.

    Args:
      endpoint: Incoming endpoint (must be the Interrupt OUT pipe).
      data: Interrupt packet data.
    """
    assert endpoint == self._out_endpoint

    if 0 in self._features:
      self._features[0].SetOutputReport(data)
    elif len(data) >= 1:
      report_id, = struct.unpack('B', data[0])
      feature = self._features.get(report_id, None)
      if feature is None or feature.SetOutputReport(data[1:]) is None:
        self.HaltEndpoint(endpoint)
Dispatch a report to the appropriate feature.

    See Device Class Definition for Human Interface Devices (HID) Version 1.11
    section 8.

    Args:
      endpoint: Incoming endpoint (must be the Interrupt OUT pipe).
      data: Interrupt packet data.
    
Dispatch a report to the appropriate feature.
See Device Class Definition for Human Interface Devices (HID) Version 1.11
section 8.
Dispatch a report to the appropriate feature . See Device Class Definition for Human Interface Devices ( HID ) Version 1 . 11 section 8 .
def ReceivePacket(self, endpoint, data):
    assert endpoint == self._out_endpoint
    if 0 in self._features:
      self._features[0].SetOutputReport(data)
    elif len(data) >= 1:
      report_id, = struct.unpack('B', data[0])
      feature = self._features.get(report_id, None)
      if feature is None or feature.SetOutputReport(data[1:]) is None:
        self.HaltEndpoint(endpoint)
def ReceivePacket ( self , endpoint , data ) : assert endpoint == self . _out_endpoint if 0 in self . _features : self . _features [ 0 ] . SetOutputReport ( data ) elif len ( data ) >= 1 : report_id , = struct . unpack ( 'B' , data [ 0 ] ) feature = self . _features . get ( report_id , None ) if feature is None or feature . SetOutputReport ( data [ 1 : ] ) is None : self . HaltEndpoint ( endpoint )
Dispatch a report to the appropriate feature.
Dispatch a report to the appropriate feature .
"""Dispatch a report to the appropriate feature.

    See Device Class Definition for Human Interface Devices (HID) Version 1.11
    section 8.

    Args:
      endpoint: Incoming endpoint (must be the Interrupt OUT pipe).
      data: Interrupt packet data.
    """
self
endpoint
Incoming endpoint (must be the Interrupt OUT pipe).
Incoming endpoint ( must be the Interrupt OUT pipe ) .
data
Interrupt packet data.
Interrupt packet data .