Interface UsbInterface


public interface UsbInterface
USB interface.

Instances of this class describe an interface of a USB device.

  • Method Details

    • getNumber

      int getNumber()
      Gets the interface number.

      It is equal to the bInterfaceNumber field of the interface descriptor.

      Returns:
      the interface number
    • isClaimed

      boolean isClaimed()
      Indicates if this interface has been claimed by this program for exclusive access.
      Returns:
      true if it is claimed, false otherwise.
    • getCurrentAlternate

      @NotNull @NotNull UsbAlternateInterface getCurrentAlternate()
      Gets the currently selected alternate interface setting.

      Initially, the alternate settings with number 0 is selected.

      Returns:
      the alternate interface setting.
    • getAlternate

      @NotNull @NotNull UsbAlternateInterface getAlternate(int alternateNumber)
      Gets the alternate interface settings with the specified number.
      Parameters:
      alternateNumber - alternate setting number
      Returns:
      alternate interface setting
      Throws:
      UsbException - if the alternate setting does not exist
    • getAlternates

      @NotNull @NotNull @Unmodifiable List<UsbAlternateInterface> getAlternates()
      Gets all alternate settings of this interface.

      The returned list is sorted by alternate setting number.

      Returns:
      a list of the alternate settings