Code example for UsbDeviceConnection

Methods: controlTransfer

0
		byte[] line_coding = new byte[0];
		 
		Integer baudRate = Integer.parseInt( s );
			 
		line_coding = new byte[]{(byte)(baudRate.intValue()&0xFF), (byte)((baudRate.intValue()>>8)&0xFF), (byte)((baudRate.intValue()>>16)&0xFF), (byte)((baudRate.intValue()>>24)&0xFF), (byte)0x00, (byte)0x00, (byte)0x08};
		connection.controlTransfer(0x21, 0x20, 0x0000, 0x0000, line_coding, line_coding.length, 20);
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java