Android APIs
public class

UsbEndpoint

extends Object
implements Parcelable
java.lang.Object
   ↳ android.hardware.usb.UsbEndpoint

Class Overview

A class representing an endpoint on a UsbInterface. Endpoints are the channels for sending and receiving data over USB. Typically bulk endpoints are used for sending non-trivial amounts of data. Interrupt endpoints are used for sending small amounts of data, typically events, separately from the main data streams. The endpoint zero is a special endpoint for control messages sent from the host to device. Isochronous endpoints are currently unsupported.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<UsbEndpoint> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
int getAddress()
Returns the endpoint's address field.
int getAttributes()
Returns the endpoint's attributes field.
int getDirection()
Returns the endpoint's direction.
int getEndpointNumber()
Extracts the endpoint's endpoint number from its address
int getInterval()
Returns the endpoint's interval field.
int getMaxPacketSize()
Returns the endpoint's maximum packet size.
int getType()
Returns the endpoint's type.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel parcel, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<UsbEndpoint> CREATOR

Added in API level 12

Public Methods

public int describeContents ()

Added in API level 12

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
int a bitmask indicating the set of special object types marshalled by the Parcelable.

public int getAddress ()

Added in API level 12

Returns the endpoint's address field. The address is a bitfield containing both the endpoint number as well as the data direction of the endpoint. the endpoint number and direction can also be accessed via getEndpointNumber() and getDirection().

Returns
int the endpoint's address

public int getAttributes ()

Added in API level 12

Returns the endpoint's attributes field.

Returns
int the endpoint's attributes

public int getDirection ()

Added in API level 12

Returns the endpoint's direction. Returns USB_DIR_OUT if the direction is host to device, and USB_DIR_IN if the direction is device to host.

Returns
int the endpoint's direction

public int getEndpointNumber ()

Added in API level 12

Extracts the endpoint's endpoint number from its address

Returns
int the endpoint's endpoint number

public int getInterval ()

Added in API level 12

Returns the endpoint's interval field.

Returns
int the endpoint's interval

public int getMaxPacketSize ()

Added in API level 12

Returns the endpoint's maximum packet size.

Returns
int the endpoint's maximum packet size

public int getType ()

Added in API level 12

Returns the endpoint's type. Possible results are:

Returns
int the endpoint's type

public String toString ()

Added in API level 12

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
String a printable representation of this object.

public void writeToParcel (Parcel parcel, int flags)

Added in API level 12

Flatten this object in to a Parcel.

Parameters
parcel The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.