Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
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

Public Methods

public int describeContents ()

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

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

public int getAddress ()

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
  • the endpoint's address

public int getAttributes ()

Returns the endpoint's attributes field.

Returns
  • the endpoint's attributes

public int getDirection ()

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
  • the endpoint's direction

public int getEndpointNumber ()

Extracts the endpoint's endpoint number from its address

Returns
  • the endpoint's endpoint number

public int getInterval ()

Returns the endpoint's interval field.

Returns
  • the endpoint's interval

public int getMaxPacketSize ()

Returns the endpoint's maximum packet size.

Returns
  • the endpoint's maximum packet size

public int getType ()

Returns the endpoint's type. Possible results are:

Returns
  • the endpoint's type

public String toString ()

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
  • a printable representation of this object.

public void writeToParcel ( Parcel parcel, int flags)

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 .