Most visited

Recently visited

Added in API level 12

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

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 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

From class java.lang.Object
From interface android.os.Parcelable

Fields

CREATOR

Added in API level 12
Creator<UsbEndpoint> CREATOR

Public methods

describeContents

Added in API level 12
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(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.

getAddress

Added in API level 12
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
int getAttributes ()

Returns the endpoint's attributes field.

Returns
int the endpoint's attributes

getDirection

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

See also:

getEndpointNumber

Added in API level 12
int getEndpointNumber ()

Extracts the endpoint's endpoint number from its address

Returns
int the endpoint's endpoint number

getInterval

Added in API level 12
int getInterval ()

Returns the endpoint's interval field.

Returns
int the endpoint's interval

getMaxPacketSize

Added in API level 12
int getMaxPacketSize ()

Returns the endpoint's maximum packet size.

Returns
int the endpoint's maximum packet size

getType

Added in API level 12
int getType ()

Returns the endpoint's type. Possible results are:

Returns
int the endpoint's type

toString

Added in API level 12
String toString ()

Returns a string representation of the object. In general, the toString 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())
 

Returns
String a string representation of the object.

writeToParcel

Added in API level 12
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.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!