public class UsbConfiguration
extends Object implements Parcelable
| java.lang.Object | |
| android.hardware.usb.UsbConfiguration | |
表示UsbDevice上的配置的UsbDevice 。 USB配置可以具有一个或多个接口,每个接口提供与其他接口分离的不同功能块。 一个接口将有一个或多个UsbEndpoint ,这是主机通过设备传输数据的通道。
有关与USB硬件通信的更多信息,请阅读 USB开发人员指南。
Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<UsbConfiguration> |
CREATOR |
公共方法(Public methods) |
|
|---|---|
int |
describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 |
int |
getId() 返回配置的ID字段。 |
UsbInterface |
getInterface(int index) 返回给定索引处的 |
int |
getInterfaceCount() 返回此配置包含的 |
int |
getMaxPower() 返回配置的最大功耗,单位为毫安。 |
String |
getName() 返回配置的名称。 |
boolean |
isRemoteWakeup() 返回remote-wakeup属性值配置的属性字段。 |
boolean |
isSelfPowered() 返回自供电属性值配置的属性字段。 |
String |
toString() 返回对象的字符串表示形式。 |
void |
writeToParcel(Parcel parcel, int flags) 将此对象平铺到一个包裹中。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
int describeContents ()
描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。
| 返回(Returns) | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
int getId ()
返回配置的ID字段。 这是一个整数,用于唯一标识设备上的配置。
| 返回(Returns) | |
|---|---|
int |
the configuration's ID |
UsbInterface getInterface (int index)
返回给定索引处的 UsbInterface 。
| 参数(Parameters) | |
|---|---|
index |
int
|
| 返回(Returns) | |
|---|---|
UsbInterface |
the interface |
int getInterfaceCount ()
返回此配置包含的 UsbInterface的数量。
| 返回(Returns) | |
|---|---|
int |
the number of endpoints |
int getMaxPower ()
返回配置的最大功耗,单位为毫安。
| 返回(Returns) | |
|---|---|
int |
the configuration's max power |
String getName ()
返回配置的名称。
| 返回(Returns) | |
|---|---|
String |
the configuration's name |
boolean isRemoteWakeup ()
返回remote-wakeup属性值配置的属性字段。 这表示设备可以通知主机从暂停状态唤醒。
| 返回(Returns) | |
|---|---|
boolean |
the configuration's remote-wakeup attribute |
boolean isSelfPowered ()
返回自供电属性值配置的属性字段。 此属性表示设备的电源不是USB连接。
| 返回(Returns) | |
|---|---|
boolean |
the configuration's self-powered attribute |
String toString ()
返回对象的字符串表示形式。 一般来说, toString方法返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。
toString类的方法Object返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| 返回(Returns) | |
|---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel parcel, int flags)
将此对象平铺到一个包裹中。
| 参数(Parameters) | |
|---|---|
parcel |
Parcel: The Parcel in which the object should be written. |
flags |
int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. |