Interface UsbInterface
public interface UsbInterface
USB interface.
Instances of this class describe an interface of a USB device.
-
Method Summary
Modifier and TypeMethodDescription@NotNull UsbAlternateInterfacegetAlternate(int alternateNumber) Gets the alternate interface settings with the specified number.@NotNull @Unmodifiable List<UsbAlternateInterface> Gets all alternate settings of this interface.@NotNull UsbAlternateInterfaceGets the currently selected alternate interface setting.intGets the interface number.booleanIndicates if this interface has been claimed by this program for exclusive access.
-
Method Details
-
getNumber
int getNumber()Gets the interface number.It is equal to the
bInterfaceNumberfield 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:
trueif it is claimed,falseotherwise.
-
getCurrentAlternate
Gets the currently selected alternate interface setting.Initially, the alternate settings with number 0 is selected.
- Returns:
- the alternate interface setting.
-
getAlternate
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
Gets all alternate settings of this interface.The returned list is sorted by alternate setting number.
- Returns:
- a list of the alternate settings
-