UsbInterface
open class UsbInterface : Parcelable
kotlin.Any | |
↳ | android.hardware.usb.UsbInterface |
A class representing an interface on a 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.
Summary
Inherited constants | |
---|---|
Public methods | |
---|---|
open Int | |
open Int |
Returns the interface's bAlternateSetting field. |
open UsbEndpoint! |
getEndpoint(index: Int) Returns the |
open Int |
Returns the number of |
open Int |
getId() Returns the interface's bInterfaceNumber field. |
open Int |
Returns the interface's class field. |
open Int |
Returns the interface's protocol field. |
open Int |
Returns the interface's subclass field. |
open String? |
getName() Returns the interface's name. |
open String |
toString() |
open Unit |
writeToParcel(parcel: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<UsbInterface!> |
Public methods
describeContents
open fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getAlternateSetting
open fun getAlternateSetting(): Int
Returns the interface's bAlternateSetting field. This is an integer that along with the ID uniquely identifies the interface on the device. UsbDeviceConnection#setInterface
can be used to switch between two interfaces with the same ID but different alternate setting.
Return | |
---|---|
Int |
the interface's alternate setting |
getEndpoint
open fun getEndpoint(index: Int): UsbEndpoint!
Returns the android.hardware.usb.UsbEndpoint
at the given index.
Return | |
---|---|
UsbEndpoint! |
the endpoint |
getEndpointCount
open fun getEndpointCount(): Int
Returns the number of android.hardware.usb.UsbEndpoint
s this interface contains.
Return | |
---|---|
Int |
the number of endpoints |
getId
open fun getId(): Int
Returns the interface's bInterfaceNumber field. This is an integer that along with the alternate setting uniquely identifies the interface on the device.
Return | |
---|---|
Int |
the interface's ID |
getInterfaceClass
open fun getInterfaceClass(): Int
Returns the interface's class field. Some useful constants for USB classes can be found in UsbConstants
Return | |
---|---|
Int |
the interface's class |
getInterfaceProtocol
open fun getInterfaceProtocol(): Int
Returns the interface's protocol field.
Return | |
---|---|
Int |
the interface's protocol |
getInterfaceSubclass
open fun getInterfaceSubclass(): Int
Returns the interface's subclass field.
Return | |
---|---|
Int |
the interface's subclass |
getName
open fun getName(): String?
Returns the interface's name.
Return | |
---|---|
String? |
the interface's name, or null if the property could not be read |
toString
open fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
parcel: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
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_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |