Package com.github.mjdev.libaums.usb
Interface UsbCommunication
-
public interface UsbCommunicationThis Interface describes a low level device to perform USB transfers. At the moment only bulk IN and OUT transfer are supported. Every class that followsBlockDeviceDrivercan use this to communicate with the underlying USB stack.
-
-
Field Summary
Fields Modifier and Type Field Description static intTRANSFER_TIMEOUT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intbulkInTransfer(java.nio.ByteBuffer dest)Performs a bulk in transfer beginning at offset zero in thebufferof lengthbuffer#remaining().intbulkOutTransfer(java.nio.ByteBuffer src)Performs a bulk out transfer beginning at the offset specified in thebufferof lengthbuffer#remaining().
-
-
-
Field Detail
-
TRANSFER_TIMEOUT
static final int TRANSFER_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
bulkOutTransfer
int bulkOutTransfer(java.nio.ByteBuffer src) throws java.io.IOExceptionPerforms a bulk out transfer beginning at the offset specified in thebufferof lengthbuffer#remaining().- Parameters:
src- The data to transfer.- Returns:
- Bytes transmitted if successful.
- Throws:
java.io.IOException
-
bulkInTransfer
int bulkInTransfer(java.nio.ByteBuffer dest) throws java.io.IOExceptionPerforms a bulk in transfer beginning at offset zero in thebufferof lengthbuffer#remaining().- Parameters:
dest- The buffer where data should be transferred.- Returns:
- Bytes read if successful.
- Throws:
java.io.IOException
-
-