Added in API level 21

UsbConfiguration


open class UsbConfiguration : Parcelable
kotlin.Any
   ↳ android.hardware.usb.UsbConfiguration

A class representing a configuration on a UsbDevice. A USB configuration 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 UsbEndpoints, which are the channels by which the host transfers data with the device.

Summary

Inherited constants
Public methods
open Int

open Int

Returns the configuration's ID field.

open UsbInterface
getInterface(index: Int)

Returns the UsbInterface at the given index.

open Int

Returns the number of UsbInterfaces this configuration contains.

open Int

Returns the configuration's max power consumption, in milliamps.

open String?

Returns the configuration's name.

open Boolean

Returns the remote-wakeup attribute value configuration's attributes field.

open Boolean

Returns the self-powered attribute value configuration's attributes field.

open String

open Unit
writeToParcel(parcel: Parcel, flags: Int)

Properties
static Parcelable.Creator<UsbConfiguration!>

Public methods

describeContents

Added in API level 21
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

getId

Added in API level 21
open fun getId(): Int

Returns the configuration's ID field. This is an integer that uniquely identifies the configuration on the device.

Return
Int the configuration's ID

getInterface

Added in API level 21
open fun getInterface(index: Int): UsbInterface

Returns the UsbInterface at the given index.

Return
UsbInterface the interface This value cannot be null.

getInterfaceCount

Added in API level 21
open fun getInterfaceCount(): Int

Returns the number of UsbInterfaces this configuration contains.

Return
Int the number of endpoints

getMaxPower

Added in API level 21
open fun getMaxPower(): Int

Returns the configuration's max power consumption, in milliamps.

Return
Int the configuration's max power

getName

Added in API level 21
open fun getName(): String?

Returns the configuration's name.

Return
String? the configuration's name, or null if the property could not be read

isRemoteWakeup

Added in API level 21
open fun isRemoteWakeup(): Boolean

Returns the remote-wakeup attribute value configuration's attributes field. This attributes that the device may signal the host to wake from suspend.

Return
Boolean the configuration's remote-wakeup attribute

isSelfPowered

Added in API level 21
open fun isSelfPowered(): Boolean

Returns the self-powered attribute value configuration's attributes field. This attribute indicates that the device has a power source other than the USB connection.

Return
Boolean the configuration's self-powered attribute

toString

Added in API level 21
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 21
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

Properties

CREATOR

Added in API level 21
static val CREATOR: Parcelable.Creator<UsbConfiguration!>