Package 

Interface UsbCommunication

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public interface UsbCommunication
     implements Closeable
                        

    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 com.github.mjdev.libaums.driver.BlockDeviceDriver can use this to communicate with the underlying USB stack.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • bulkOutTransfer

         abstract Integer bulkOutTransfer(ByteBuffer src)

        Performs a bulk out transfer beginning at the offset specified in the buffer of length buffer#remaining().

        Parameters:
        src - The data to transfer.
      • bulkInTransfer

         abstract Integer bulkInTransfer(ByteBuffer dest)

        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.
      • controlTransfer

         abstract Integer controlTransfer(Integer requestType, Integer request, Integer value, Integer index, ByteArray buffer, Integer length)

        Performs a control transaction on endpoint zero for this device.

        Parameters:
        requestType - request type for this transaction
        request - request ID for this transaction
        value - value field for this transaction
        index - index field for this transaction
        buffer - buffer for data portion of transaction, or null if no data needs to be sent or received
        length - the length of the data to send or receive
      • resetDevice

         abstract Unit resetDevice()

        Performs the recovery reset procedure in case the communication is stalled

      • clearFeatureHalt

         abstract Unit clearFeatureHalt(UsbEndpoint endpoint)

        Attempts to clear the HALT feature from the specified USB endpoint

        Parameters:
        endpoint - the USB endpoint to clear the HALT feature from