public class UsbEndpoint 
 extends Object implements Parcelable
| java.lang.Object | |
| ↳ | android.hardware.usb.UsbEndpoint | 
代表UsbInterface上端点的UsbInterface 。 端点是通过USB发送和接收数据的通道。 通常,批量端点用于发送不重要的数据量。 中断端点用于与主数据流分开发送少量数据,通常是事件。 端点零是从主机发送到设备的控制消息的特殊端点。 等时端点当前不受支持。
| Inherited constants | 
|---|
|  From interface  android.os.Parcelable  | 
| Fields | |
|---|---|
|  public static final Creator<UsbEndpoint> | CREATOR | 
| Public methods | |
|---|---|
|  int |  describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 | 
|  int |  getAddress() 返回端点的地址字段。 | 
|  int |  getAttributes() 返回端点的属性字段。 | 
|  int |  getDirection() 返回端点的方向。 | 
|  int |  getEndpointNumber() 从其地址中提取端点的端点号 | 
|  int |  getInterval() 返回端点的间隔字段。 | 
|  int |  getMaxPacketSize() 返回端点的最大数据包大小。 | 
|  int |  getType() 返回端点的类型。 | 
|  String |  toString() 返回对象的字符串表示形式。 | 
|  void |  writeToParcel(Parcel parcel, int flags) 将此对象平铺到一个包裹中。 | 
| Inherited methods | |
|---|---|
|  From class  java.lang.Object  | |
|  From interface  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 getAddress ()
返回端点的地址字段。 地址是一个包含端点号码和端点数据方向的位域。 端点号和方向也可以通过getEndpointNumber()和getDirection()访问。
| Returns | |
|---|---|
| int | the endpoint's address | 
int getAttributes ()
返回端点的属性字段。
| Returns | |
|---|---|
| int | the endpoint's attributes | 
int getDirection ()
返回端点的方向。 返回USB_DIR_OUT如果方向是主机设备,并且USB_DIR_IN如果方向是设备到主机。
| Returns | |
|---|---|
| int | the endpoint's direction | 
int getEndpointNumber ()
从其地址中提取端点的端点号
| Returns | |
|---|---|
| int | the endpoint's endpoint number | 
int getMaxPacketSize ()
返回端点的最大数据包大小。
| Returns | |
|---|---|
| int | the endpoint's maximum packet size | 
int getType ()
返回端点的类型。 可能的结果是:
USB_ENDPOINT_XFER_CONTROL (endpoint zero) USB_ENDPOINT_XFER_ISOC (isochronous endpoint) USB_ENDPOINT_XFER_BULK (bulk endpoint) USB_ENDPOINT_XFER_INT (interrupt endpoint) | Returns | |
|---|---|
| int | the endpoint's type | 
String toString ()
返回对象的字符串表示形式。 通常, toString方法会返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。
类Object的toString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:
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 orPARCELABLE_WRITE_RETURN_VALUE. |