|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.jusb.UsbInterfaceImp
public class UsbInterfaceImp
UsbInterface platform-independent implementation.
This must be set up before use.
setter
.setter
.setter
.
If not set, it defaults to a DefaultUsbInterfaceOsImp
.directly
or by
setUsbConfigurationImp
, it must be
set
after creating the active alternate setting.added
.
When changing the active alternate setting, call the setActiveSettingNumber
method.
This will update the parent config's active interface setting map.
Constructor Summary | |
---|---|
UsbInterfaceImp(UsbConfigurationImp config,
UsbInterfaceDescriptor desc)
Constructor. |
|
UsbInterfaceImp(UsbConfigurationImp config,
UsbInterfaceDescriptor desc,
UsbInterfaceOsImp osImp)
Constructor. |
Method Summary | |
---|---|
void |
addUsbEndpointImp(UsbEndpointImp ep)
|
void |
claim()
Claim this interface. |
void |
claim(UsbInterfacePolicy policy)
Claim this interface using a UsbInterfacePolicy. |
boolean |
containsSetting(byte number)
If the specified alternate setting exists. |
boolean |
containsUsbEndpoint(byte address)
If the specified UsbEndpoint is contained in this UsbInterface. |
UsbInterface |
getActiveSetting()
Get the active alternate setting. |
UsbInterfaceImp |
getActiveSettingImp()
Get the active alternate setting. |
byte |
getActiveSettingNumber()
Get the number of the active alternate setting for this interface |
java.lang.String |
getInterfaceString()
Get the interface String. |
int |
getNumSettings()
Get the number of alternate settings for this interface. |
UsbInterface |
getSetting(byte number)
Get the alternate setting with the specified number. |
UsbInterfaceImp |
getSettingImp(byte number)
Get the alternate setting with the specified number. |
java.util.List |
getSettings()
Get all alternate settings for this interface. |
UsbConfiguration |
getUsbConfiguration()
Get the parent UsbConfiguration that this UsbInterface belongs to. |
UsbConfigurationImp |
getUsbConfigurationImp()
|
UsbEndpoint |
getUsbEndpoint(byte address)
Get a specific UsbEndpoint. |
UsbEndpointImp |
getUsbEndpointImp(byte address)
|
java.util.List |
getUsbEndpoints()
Get all endpoints for this interface setting. |
UsbInterfaceDescriptor |
getUsbInterfaceDescriptor()
Get the interface descriptor. |
UsbInterfaceOsImp |
getUsbInterfaceOsImp()
|
boolean |
isActive()
If this interface setting is active. |
boolean |
isClaimed()
If this interface is claimed. |
boolean |
isJavaClaimed()
If this is claimed in java. |
void |
release()
Release this interface. |
void |
setActiveSettingNumber(byte number)
Set the active alternate setting number for ALL UsbInterfaces on the AlternateSettings list |
void |
setUsbConfigurationImp(UsbConfigurationImp config)
Set the UsbConfigurationImp. |
void |
setUsbInterfaceDescriptor(UsbInterfaceDescriptor desc)
|
void |
setUsbInterfaceOsImp(UsbInterfaceOsImp iface)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UsbInterfaceImp(UsbConfigurationImp config, UsbInterfaceDescriptor desc)
config
- The parent config. If this is not null, the UsbInterfaceDescriptor cannot be null.desc
- This interface's descriptor. This cannot be null if the parent config is not null.public UsbInterfaceImp(UsbConfigurationImp config, UsbInterfaceDescriptor desc, UsbInterfaceOsImp osImp)
config
- The parent config. If this is not null, the UsbInterfaceDescriptor cannot be null.desc
- This interface's descriptor. This cannot be null if the parent config is not null.osImp
- The UsbInterfaceOsImp.Method Detail |
---|
public void claim() throws UsbClaimException, UsbException, UsbNotActiveException, UsbDisconnectedException
This calls the other claim
with a default policy
.
claim
in interface UsbInterface
UsbClaimException
- If the interface is already claimed.
UsbException
- if the interface could not be claimed.
UsbNotActiveException
- if the interface setting is not active.
UsbDisconnectedException
- If this device has been disconnected.public void claim(UsbInterfacePolicy policy) throws UsbClaimException, UsbException, UsbNotActiveException, UsbDisconnectedException
This will claim all alternate settings using the provided UsbInterfacePolicy. If the interface is already claimed this will fail.
This can only be called from an
active
alternate setting.
claim
in interface UsbInterface
policy
- The UsbInterfacePolicy to use.
UsbClaimException
- If the interface is already claimed.
UsbException
- if the interface could not be claimed.
UsbNotActiveException
- if the interface setting is not active.
UsbDisconnectedException
- If this device has been disconnected.public void release() throws UsbClaimException, UsbException, UsbNotActiveException, UsbDisconnectedException
release
in interface UsbInterface
UsbClaimException
- If the interface is already claimed.
UsbException
- if the interface could not be released.
UsbNotActiveException
- if the interface setting is not active.
UsbDisconnectedException
- If this device has been disconnected.public boolean isClaimed()
UsbInterface
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 active
, this will
return if the active alternate setting is active.
isClaimed
in interface UsbInterface
public boolean isJavaClaimed()
This should only be used by javax.usb implementations; this is not part of the javax.usb API.
public boolean isActive()
isActive
in interface UsbInterface
public java.util.List getUsbEndpoints()
UsbInterface
getUsbEndpoints
in interface UsbInterface
public UsbEndpoint getUsbEndpoint(byte address)
UsbInterface
If this does not contain the specified endpoint, this returns null.
getUsbEndpoint
in interface UsbInterface
address
- The address of the UsbEndpoint to get.
public UsbEndpointImp getUsbEndpointImp(byte address)
address
- The address of the UsbEndpointImp to get.
public boolean containsUsbEndpoint(byte address)
UsbInterface
containsUsbEndpoint
in interface UsbInterface
address
- the address of the UsbEndpoint to check.
public UsbConfiguration getUsbConfiguration()
UsbInterface
getUsbConfiguration
in interface UsbInterface
public UsbConfigurationImp getUsbConfigurationImp()
public void setUsbConfigurationImp(UsbConfigurationImp config)
This also adds this to the parent UsbConfigurationImp. The
UsbInterfaceDescriptor must be set
before calling this.
config
- The parent configpublic int getNumSettings()
UsbInterface
getNumSettings
in interface UsbInterface
public byte getActiveSettingNumber() throws UsbNotActiveException
getActiveSettingNumber
in interface UsbInterface
UsbNotActiveException
- if the interface is inactive.public UsbInterface getActiveSetting() throws UsbNotActiveException
getActiveSetting
in interface UsbInterface
UsbNotActiveException
- if the interface (not setting) is inactive.public UsbInterfaceImp getActiveSettingImp() throws UsbNotActiveException
UsbNotActiveException
- if the interface (not setting) is inactive.public UsbInterface getSetting(byte number)
getSetting
in interface UsbInterface
public UsbInterfaceImp getSettingImp(byte number)
public boolean containsSetting(byte number)
UsbInterface
containsSetting
in interface UsbInterface
number
- the number of the alternate setting to check.
public java.util.List getSettings()
getSettings
in interface UsbInterface
public UsbInterfaceDescriptor getUsbInterfaceDescriptor()
UsbInterface
The descriptor may be cached.
getUsbInterfaceDescriptor
in interface UsbInterface
public java.lang.String getInterfaceString() throws UsbException, java.io.UnsupportedEncodingException, UsbDisconnectedException
UsbInterface
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.
getInterfaceString
in interface UsbInterface
UsbException
- If there was an error getting the UsbStringDescriptor.
java.io.UnsupportedEncodingException
- If the string encoding is not supported.
UsbDisconnectedException
- If this interface (device) has been disconnected.public UsbInterfaceOsImp getUsbInterfaceOsImp()
public void setUsbInterfaceOsImp(UsbInterfaceOsImp iface)
iface
- The UsbInterfaceOsImp to usepublic void setUsbInterfaceDescriptor(UsbInterfaceDescriptor desc)
desc
- the new interface descriptorpublic void setActiveSettingNumber(byte number) throws java.lang.IllegalArgumentException
number
- The number of the active alternate setting
java.lang.IllegalArgumentException
- If the specified setting does not exist in this interface.public void addUsbEndpointImp(UsbEndpointImp ep)
ep
- the endpoint to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |