UsbEndpoint


public class UsbEndpoint
extends Object implements Parcelable

java.lang.Object
   ↳ android.hardware.usb.UsbEndpoint


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

Inherited constants

Fields

public static final Creator<UsbEndpoint> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled 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 representation of the object.

void writeToParcel(Parcel parcel, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 12
public static final Creator<UsbEndpoint> CREATOR

Public methods

describeContents

Added in API level 12
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getAddress

Added in API level 12
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
int the endpoint's address

getAttributes

Added in API level 12
public int getAttributes ()

Returns the endpoint's attributes field.

Returns
int the endpoint's attributes

getDirection

Added in API level 12
public int getDirection ()

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

Returns
int the endpoint's direction

getEndpointNumber

Added in API level 12
public int getEndpointNumber ()

Extracts the endpoint's endpoint number from its address

Returns
int the endpoint's endpoint number

getInterval

Added in API level 12
public int getInterval ()

Returns the endpoint's interval field.

Returns
int the endpoint's interval

getMaxPacketSize

Added in API level 12
public int getMaxPacketSize ()

Returns the endpoint's maximum packet size.

Returns
int the endpoint's maximum packet size

getType

Added in API level 12
public int getType ()

Returns the endpoint's type. Possible results are:

Returns
int the endpoint's type

toString

Added in API level 12
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

writeToParcel

Added in API level 12
public void writeToParcel (Parcel parcel, 
                int flags)

Flatten this object in to a Parcel.

Parameters
parcel Parcel: The Parcel in which the object should be written. This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES