public class UsbConfigurationImp extends Object implements UsbConfiguration
This must be set up before use.
| Constructor and Description |
|---|
UsbConfigurationImp(UsbDeviceImp device,
UsbConfigurationDescriptor desc)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUsbInterfaceImp(UsbInterfaceImp setting)
Add a UsbInterfaceImp.
|
boolean |
containsUsbInterface(byte number)
If the specified UsbInterface is contained in this UsbConfiguration.
|
String |
getConfigurationString()
Get the configuration String.
|
UsbConfigurationDescriptor |
getUsbConfigurationDescriptor()
Get the configuration descriptor.
|
UsbDevice |
getUsbDevice()
Get the parent UsbDevice that this UsbConfiguration belongs to.
|
UsbDeviceImp |
getUsbDeviceImp() |
UsbInterface |
getUsbInterface(byte number)
Get a UsbInterface.
|
UsbInterfaceImp |
getUsbInterfaceImp(byte number)
Get a UsbInterfaceImp.
|
List |
getUsbInterfaces()
Get all UsbInterfaces for this configuration.
|
List |
getUsbInterfaceSettingList(byte number)
Get the List of settings for the specified interface numer.
|
boolean |
isActive()
If this UsbConfiguration is active.
|
void |
setActiveUsbInterfaceImpSetting(UsbInterfaceImp setting)
Change an interface setting to be the active alternate setting.
|
void |
setUsbConfigurationDescriptor(UsbConfigurationDescriptor desc) |
void |
setUsbDeviceImp(UsbDeviceImp device)
Set the UsbDeviceImp.
|
public UsbConfigurationImp(UsbDeviceImp device, UsbConfigurationDescriptor desc)
device - The parent device.desc - This configuration's descriptor.public boolean isActive()
UsbConfigurationisActive in interface UsbConfigurationpublic List getUsbInterfaces()
UsbConfigurationThe returned UsbInterface settings depend on whether this configuration (and by association its contained interfaces) is active or not:
UsbInterface.getSetting(byte number).getUsbInterfaces in interface UsbConfigurationpublic UsbInterface getUsbInterface(byte number)
getUsbInterface in interface UsbConfigurationnumber - The number of the interface to getpublic UsbInterfaceImp getUsbInterfaceImp(byte number)
number - The number of the interface to get.public boolean containsUsbInterface(byte number)
UsbConfigurationcontainsUsbInterface in interface UsbConfigurationnumber - the number of the UsbInterface to check.public void addUsbInterfaceImp(UsbInterfaceImp setting)
The first setting for a particular interface number will default as the active setting. If the setting being added has already been added, it will be changed to be the active setting for the interface number.
setting - The UsbInterfaceImp to add.public void setActiveUsbInterfaceImpSetting(UsbInterfaceImp setting)
This behaves identical to addUsbInterfaceImp.
setting - The UsbInterfaceImp setting to change.public List getUsbInterfaceSettingList(byte number)
number - The interface number.public UsbDevice getUsbDevice()
UsbConfigurationgetUsbDevice in interface UsbConfigurationpublic UsbDeviceImp getUsbDeviceImp()
public void setUsbDeviceImp(UsbDeviceImp device)
This will also add this to the parent UsbDeviceImp.
device - The parent UsbDeviceImppublic UsbConfigurationDescriptor getUsbConfigurationDescriptor()
UsbConfigurationThe descriptor may be cached.
getUsbConfigurationDescriptor in interface UsbConfigurationpublic String getConfigurationString() throws UsbException, UsbEncodingException, UsbDisconnectedException
UsbConfigurationThis is a convienence method. The String may be cached. If the device does not support strings or does not define the configuration string, this returns null.
getConfigurationString in interface UsbConfigurationUsbException - If there was an error getting the UsbStringDescriptor.UsbEncodingException - If the string encoding is not supported.UsbDisconnectedException - If the device has been disconnected.public void setUsbConfigurationDescriptor(UsbConfigurationDescriptor desc)
desc - the new configuration descriptorCopyright © 2014 LSST. All Rights Reserved.