public class USBEndpoint 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| 构造器 | 说明 |
|---|---|
USBEndpoint(int address,
int attributes,
int direction,
int number,
int interval,
int maxPacketSize,
int type) |
Creates a
USBEndpoint instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getAddress() |
Get the endpoint address.
|
int |
getAttributes() |
Get the endpoint attributes.
|
int |
getDirection() |
Get the endpoint direction.
|
int |
getEndpointNumber() |
Get the endpoint number.
|
int |
getInterval() |
Get the endpoint interval.
|
int |
getMaxPacketSize() |
Get the maximum packet size of this endpoint.
|
int |
getType() |
Get the endpoint type.
|
String |
toString() |
Returns a string representation of the object.
|
public USBEndpoint(int address,
int attributes,
int direction,
int number,
int interval,
int maxPacketSize,
int type)
USBEndpoint instance.address - Indicates the USB endpoint address, which consists of the endpoint ID and data transfer direction.attributes - Indicates USB endpoint attributes, such as the data transfer type.direction - Indicates the USB endpoint direction. Value 0 indicates OUT, and value 1 indicates IN.number - Indicates the USB endpoint number, which uniquely identifies a USB endpoint on a USB device.interval - Indicates the polling interval of the USB endpoint during data transfer.maxPacketSize - Indicates the maximum packet size of the USB endpoint, that is, the maximum size of packets
that can be received or transmitted by the endpoint after it is activated.type - Indicates the USB endpoint type.public int getAddress()
public int getAttributes()
public int getDirection()
public int getEndpointNumber()
public int getInterval()
public int getMaxPacketSize()
public int getType()
public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())