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
Public methods
describeContents
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
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
public int getAttributes ()
Returns the endpoint's attributes field.
Returns | |
---|---|
int |
the endpoint's attributes |
getDirection
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
public int getEndpointNumber ()
Extracts the endpoint's endpoint number from its address
Returns | |
---|---|
int |
the endpoint's endpoint number |
getInterval
public int getInterval ()
Returns the endpoint's interval field.
Returns | |
---|---|
int |
the endpoint's interval |
getMaxPacketSize
public int getMaxPacketSize ()
Returns the endpoint's maximum packet size.
Returns | |
---|---|
int |
the endpoint's maximum packet size |
getType
public int getType ()
Returns the endpoint's type. Possible results are:
UsbConstants.USB_ENDPOINT_XFER_CONTROL
(endpoint zero)UsbConstants.USB_ENDPOINT_XFER_ISOC
(isochronous endpoint)UsbConstants.USB_ENDPOINT_XFER_BULK
(bulk endpoint)UsbConstants.USB_ENDPOINT_XFER_INT
(interrupt endpoint)
Returns | |
---|---|
int |
the endpoint's type |
toString
public String toString ()
Returns a string representation of the object.
Returns | |
---|---|
String |
a string representation of the object. |
writeToParcel
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 |