Interface UsbCommunication


  • public interface UsbCommunication
    This Interface describes a low level device to perform USB transfers. At the moment only bulk IN and OUT transfer are supported. Every class that follows BlockDeviceDriver can use this to communicate with the underlying USB stack.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TRANSFER_TIMEOUT  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int bulkInTransfer​(java.nio.ByteBuffer dest)
      Performs a bulk in transfer beginning at offset zero in the buffer of length buffer#remaining().
      int bulkOutTransfer​(java.nio.ByteBuffer src)
      Performs a bulk out transfer beginning at the offset specified in the buffer of length buffer#remaining().
    • Method Detail

      • bulkOutTransfer

        int bulkOutTransfer​(java.nio.ByteBuffer src)
                     throws java.io.IOException
        Performs a bulk out transfer beginning at the offset specified in the buffer of length buffer#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.IOException
        Performs a bulk in transfer beginning at offset zero in the buffer of length buffer#remaining().
        Parameters:
        dest - The buffer where data should be transferred.
        Returns:
        Bytes read if successful.
        Throws:
        java.io.IOException