This object actually represents a specific 'alternate' setting for a USB interface. Interfaces must have at least one alternate setting, and one and only one setting is active per interface. All settings share the same interface number. If this interface setting is not active, it cannot be claimed or released; the active interface setting should be used for claiming and releasing ownership of the interface; also no action may be taken on any parts of this interface setting, if the setting is not active. Any attempt to perform action on objects belonging to an inactive interface setting will throw a UsbNotActiveException.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | claim(UsbInterfacePolicy
The UsbInterfacePolicy to use. policy)Claim this interface using a UsbInterfacePolicy. |
| public boolean | Returns: If the alternate setting exists.The alternate setting number. number)If the specified alternate setting exists. |
| public boolean | Returns: If this UsbInterface contains the specified UsbEndpoint.The endpoint address. address)If the specified UsbEndpoint is contained in this UsbInterface. |
| public UsbInterface | |
| public byte | Returns: The active setting number for this interface.Get the number of the active alternate setting. |
| public String | |
| public int | Returns: the number of alternate settings for this interface.Get the number of alternate settings for this interface. |
| public UsbInterface | Returns: The specified alternate setting, or null.Get the specified alternate setting. |
| public List | Returns: All alternate settings for this interface.Get all alternate settings for this interface. |
| public UsbConfiguration | Returns: The UsbConfiguration that this interface belongs to.Get the parent UsbConfiguration that this UsbInterface belongs to. |
| public UsbEndpoint | Returns: The specified UsbEndpoint, or null.The address of the UsbEndpoint to get. address)Get a specific UsbEndpoint. |
| public List | Returns: All endpoints for this setting.Get all endpoints for this interface setting. |
| public UsbInterfaceDescriptor | |
| public boolean | Returns: if this interface alternate setting is active.If this interface alternate setting is active. |
| public boolean | |
| public void |
| claim | back to summary |
|---|---|
| public void claim() throws UsbClaimException, UsbException, UsbNotActiveException, UsbDisconnectedException Claim this interface. This will attempt whatever claiming the native implementation provides, if any. If the interface is already claimed, or the native claim fails, this will fail. This must be done before opening and/or using any UsbPipes.
| |
| claim | back to summary |
|---|---|
| public void claim(UsbInterfacePolicy policy) throws UsbClaimException, UsbException, UsbNotActiveException, UsbDisconnectedException Claim this interface using a UsbInterfacePolicy.
This will attempt whatever claiming the native implementation provides,
if any. If the native claim fails, this will fail. If the interface
is already claimed, this may fail depending on the value of the
| |
| containsSetting | back to summary |
|---|---|
| public boolean containsSetting(byte number) If the specified alternate setting exists.
| |
| containsUsbEndpoint | back to summary |
|---|---|
| public boolean containsUsbEndpoint(byte address) If the specified UsbEndpoint is contained in this UsbInterface.
| |
| getActiveSetting | back to summary |
|---|---|
| public UsbInterface getActiveSetting() throws UsbNotActiveException Get the active alternate setting.
| |
| getActiveSettingNumber | back to summary |
|---|---|
| public byte getActiveSettingNumber() throws UsbNotActiveException Get the number of the active alternate setting.
| |
| getInterfaceString | back to summary |
|---|---|
| public String getInterfaceString() throws UsbException, UnsupportedEncodingException, UsbDisconnectedException Get the interface String. This is a convienence method. The String may be cached. If the device does not support strings or does not define the interface string, this returns null.
| |
| getNumSettings | back to summary |
|---|---|
| public int getNumSettings() Get the number of alternate settings for this interface.
| |
| getSetting | back to summary |
|---|---|
| public UsbInterface getSetting(byte number) Get the specified alternate setting. If the specified setting does not exist, this returns null.
| |
| getSettings | back to summary |
|---|---|
| public List Get all alternate settings for this interface. This returns all alternate settings, including this one.
| |
| getUsbConfiguration | back to summary |
|---|---|
| public UsbConfiguration getUsbConfiguration() Get the parent UsbConfiguration that this UsbInterface belongs to.
| |
| getUsbEndpoint | back to summary |
|---|---|
| public UsbEndpoint getUsbEndpoint(byte address) Get a specific UsbEndpoint. If this does not contain the specified endpoint, this returns null.
| |
| getUsbEndpoints | back to summary |
|---|---|
| public List Get all endpoints for this interface setting.
| |
| getUsbInterfaceDescriptor | back to summary |
|---|---|
| public UsbInterfaceDescriptor getUsbInterfaceDescriptor() Get the interface descriptor. The descriptor may be cached.
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() If this interface alternate setting is active.
The interface itself is active if and only if its parent
configuration is
| |
| isClaimed | back to summary |
|---|---|
| public boolean isClaimed() If this interface is claimed. This will return true if claimed in Java. This may, depending on implementation, return true if claimed natively (outside of Java)
If this UsbInterface is not
| |
| release | back to summary |
|---|---|
| public void release() throws UsbClaimException, UsbException, UsbNotActiveException, UsbDisconnectedException Release this interface. This will only succeed if the interface has been properly claimed. If the native release fails, this will fail. This should be done after the interface is no longer being used. All pipes must be closed before this can be released.
| |