public class USBConfig extends Object
When using this class, a USB device is attached to a USB host. According to the USB protocol specifications, a device contains one or more configurations, a configuration contains one or more interfaces, and an interface contains one or more endpoints.
SystemCapability.Usb#USB_MANAGER| 构造器 | 说明 |
|---|---|
USBConfig(int id,
int maxPower,
String name,
boolean isRemoteWakeup,
boolean isSelfPowered) |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getId() |
Get the current configuration ID.
|
USBInterface |
getInterface(int index) |
Get a
USBInterface object by index in the USBConfig. |
int |
getInterfaceCount() |
Get the number of interfaces of the configuration.
|
int |
getMaxPower() |
Get the maximum power consumption of the current configuration.
|
String |
getName() |
Get the current configuration name.
|
boolean |
isRemoteWakeup() |
Checks whether the current configuration supports remote wakeup.
|
boolean |
isSelfPowered() |
Checks whether the configuration supports an independent power source.
|
void |
setInterfaces(USBInterface[] interfaces) |
Sets a local
USBInterface object. |
public USBConfig(int id,
int maxPower,
String name,
boolean isRemoteWakeup,
boolean isSelfPowered)
public USBInterface getInterface(int index)
USBInterface object by index in the USBConfig.index - Indicates the USBInterface object index in the USBConfig.USBInterface object .public void setInterfaces(USBInterface[] interfaces)
USBInterface object.interfaces - Indicates a local USBInterface object.public int getInterfaceCount()
public int getId()
public int getMaxPower()
public String getName()
public boolean isRemoteWakeup()
true if the configuration supports remote wakeup; returns false otherwise.public boolean isSelfPowered()
true if the configuration supports an independent power source;
returns false otherwise.