public class UsbInterface extends Object implements Parcelable
UsbDevice
.
USB devices can have one or more interfaces, each one providing a different
piece of functionality, separate from the other interfaces.
An interface will have one or more UsbEndpoint
s, which are the
channels by which the host transfers data with the device.
For more information about communicating with USB hardware, read the USB developer guide.
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<UsbInterface> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
UsbInterface(int id,
int Class,
int subClass,
int protocol,
Parcelable[] endpoints)
UsbInterface should only be instantiated by UsbService implementation
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
UsbEndpoint |
getEndpoint(int index)
Returns the
UsbEndpoint at the given index. |
int |
getEndpointCount()
Returns the number of
UsbEndpoint s this interface contains. |
int |
getId()
Returns the interface's ID field.
|
int |
getInterfaceClass()
Returns the interface's class field.
|
int |
getInterfaceProtocol()
Returns the interface's protocol field.
|
int |
getInterfaceSubclass()
Returns the interface's subclass field.
|
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.
|
public static final Parcelable.Creator<UsbInterface> CREATOR
public UsbInterface(int id, int Class, int subClass, int protocol, Parcelable[] endpoints)
public int getId()
public int getInterfaceClass()
UsbConstants
public int getInterfaceSubclass()
public int getInterfaceProtocol()
public int getEndpointCount()
UsbEndpoint
s this interface contains.public UsbEndpoint getEndpoint(int index)
UsbEndpoint
at the given index.public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public int describeContents()
Parcelable
describeContents
in interface Parcelable
public void writeToParcel(Parcel parcel, int flags)
Parcelable
writeToParcel
in interface Parcelable
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.PARCELABLE_WRITE_RETURN_VALUE
.