Code example for UsbDeviceConnection

Methods: bulkTransfer

0
    ControllerStateDecoder decodder;
     
    @Override 
    public GameControllerState read() throws IOException 
    { 
        int i =  readDataConnection.bulkTransfer(usbEndpointRead, buf, bufferSize, 5);
        if (i > 0) {
            return decodder.decodeState(new ControllerData(buf, i + 1));
        } else  { 
            return null; 
        } 
    } 
     
    public UsbHostController(UsbDevice dev, UsbManager manager, ControllerStateDecoder decodder) throws IOException
    { 
        this.decodder = decodder;
         
        this.dev = dev;
        readDataConnection = manager.openDevice(dev); 
        if (null == readDataConnection) {
Experience pair programming with AI  Get Codota for Java