tools/usb_gadget/linux_gadgetfs.py
def Create(self, gadget):
    """Bind a gadget to the USB peripheral controller."""
    self._gadget = gadget
    self._fd = os.open(os.path.join(self._ep_dir, self._chip), os.O_RDWR)
    buf = ''.join([struct.pack('=I', 0),
                   gadget.GetFullSpeedConfigurationDescriptor().Encode(),
                   gadget.GetHighSpeedConfigurationDescriptor().Encode(),
                   gadget.GetDeviceDescriptor().Encode()])
    os.write(self._fd, buf)
    self._io_loop.add_handler(self._fd, self.HandleEvent, self._io_loop.READ)
Bind a gadget to the USB peripheral controller.
Bind a gadget to the USB peripheral controller.
Bind a gadget to the USB peripheral controller .
def Create(self, gadget):
    self._gadget = gadget
    self._fd = os.open(os.path.join(self._ep_dir, self._chip), os.O_RDWR)
    buf = ''.join([struct.pack('=I', 0),
                   gadget.GetFullSpeedConfigurationDescriptor().Encode(),
                   gadget.GetHighSpeedConfigurationDescriptor().Encode(),
                   gadget.GetDeviceDescriptor().Encode()])
    os.write(self._fd, buf)
    self._io_loop.add_handler(self._fd, self.HandleEvent, self._io_loop.READ)
def Create ( self , gadget ) : self . _gadget = gadget self . _fd = os . open ( os . path . join ( self . _ep_dir , self . _chip ) , os . O_RDWR ) buf = '' . join ( [ struct . pack ( '=I' , 0 ) , gadget . GetFullSpeedConfigurationDescriptor ( ) . Encode ( ) , gadget . GetHighSpeedConfigurationDescriptor ( ) . Encode ( ) , gadget . GetDeviceDescriptor ( ) . Encode ( ) ] ) os . write ( self . _fd , buf ) self . _io_loop . add_handler ( self . _fd , self . HandleEvent , self . _io_loop . READ )
Bind a gadget to the USB peripheral controller.
Bind a gadget to the USB peripheral controller .
"""Bind a gadget to the USB peripheral controller."""
self
gadget