Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/hardware/usb/UsbConstants#constants) \| [Ctors](https://developer.android.com/reference/android/hardware/usb/UsbConstants#pubctors) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/usb/UsbConstants#inhmethods)

# UsbConstants

*** ** * ** ***

` public final class UsbConstants `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.usb.UsbConstants |

<br />

*** ** * ** ***

Contains constants for the USB protocol. These constants correspond to definitions in linux/usb/ch9.h in the linux kernel.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_APP_SPEC` Application specific USB class. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_AUDIO` USB class for audio devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_CDC_DATA` USB class for CDC devices (communications device class). |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_COMM` USB class for communication devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_CONTENT_SEC` USB class for content security devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_CSCID` USB class for content smart card devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_HID` USB class for human interface devices (for example, mice and keyboards). |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_HUB` USB class for USB hubs. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_MASS_STORAGE` USB class for mass storage devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_MISC` USB class for wireless miscellaneous devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_PER_INTERFACE` USB class indicating that the class is determined on a per-interface basis. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_PHYSICA` USB class for physical devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_PRINTER` USB class for printers. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_STILL_IMAGE` USB class for still image devices (digital cameras). |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_VENDOR_SPEC` Vendor specific USB class. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_VIDEO` USB class for video devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_CLASS_WIRELESS_CONTROLLER` USB class for wireless controller devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_DIR_IN` Used to signify direction of data for a `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` is IN (device to host) |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_DIR_OUT` Used to signify direction of data for a `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` is OUT (host to device) |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_DIR_MASK` Bitmask used for extracting the `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` direction from its address field. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_NUMBER_MASK` Bitmask used for extracting the `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` number its address field. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFERTYPE_MASK` Bitmask used for extracting the `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` type from its address field. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_BULK` Bulk endpoint type |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_CONTROL` Control endpoint type (endpoint zero) |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_INT` Interrupt endpoint type |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_ISOC` Isochronous endpoint type (currently not supported) |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_INTERFACE_SUBCLASS_BOOT` Boot subclass for HID devices. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_SUBCLASS_VENDOR_SPEC` Vendor specific USB subclass. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_TYPE_CLASS` Used to specify that an endpoint zero control request is a class specific request. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_TYPE_MASK` Bitmask used for encoding the request type for a control request on endpoint zero. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_TYPE_RESERVED` Reserved endpoint zero control request type (currently unused). |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_TYPE_STANDARD` Used to specify that an endpoint zero control request is a standard request. |
| `int` | `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_TYPE_VENDOR` Used to specify that an endpoint zero control request is a vendor specific request. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/usb/UsbConstants#UsbConstants()() ` |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### USB_CLASS_APP_SPEC

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_APP_SPEC
```

Application specific USB class.

<br />

Constant Value: 254 (0x000000fe)

### USB_CLASS_AUDIO

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_AUDIO
```

USB class for audio devices.

<br />

Constant Value: 1 (0x00000001)

### USB_CLASS_CDC_DATA

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_CDC_DATA
```

USB class for CDC devices (communications device class).

<br />

Constant Value: 10 (0x0000000a)

### USB_CLASS_COMM

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_COMM
```

USB class for communication devices.

<br />

Constant Value: 2 (0x00000002)

### USB_CLASS_CONTENT_SEC

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_CONTENT_SEC
```

USB class for content security devices.

<br />

Constant Value: 13 (0x0000000d)

### USB_CLASS_CSCID

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_CSCID
```

USB class for content smart card devices.

<br />

Constant Value: 11 (0x0000000b)

### USB_CLASS_HID

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_HID
```

USB class for human interface devices (for example, mice and keyboards).

<br />

Constant Value: 3 (0x00000003)

### USB_CLASS_HUB

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_HUB
```

USB class for USB hubs.

<br />

Constant Value: 9 (0x00000009)

### USB_CLASS_MASS_STORAGE

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_MASS_STORAGE
```

USB class for mass storage devices.

<br />

Constant Value: 8 (0x00000008)

### USB_CLASS_MISC

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_MISC
```

USB class for wireless miscellaneous devices.

<br />

Constant Value: 239 (0x000000ef)

### USB_CLASS_PER_INTERFACE

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_PER_INTERFACE
```

USB class indicating that the class is determined on a per-interface basis.

<br />

Constant Value: 0 (0x00000000)

### USB_CLASS_PHYSICA

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_PHYSICA
```

USB class for physical devices.

<br />

Constant Value: 5 (0x00000005)

### USB_CLASS_PRINTER

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_PRINTER
```

USB class for printers.

<br />

Constant Value: 7 (0x00000007)

### USB_CLASS_STILL_IMAGE

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_STILL_IMAGE
```

USB class for still image devices (digital cameras).

<br />

Constant Value: 6 (0x00000006)

### USB_CLASS_VENDOR_SPEC

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_VENDOR_SPEC
```

Vendor specific USB class.

<br />

Constant Value: 255 (0x000000ff)

### USB_CLASS_VIDEO

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_VIDEO
```

USB class for video devices.

<br />

Constant Value: 14 (0x0000000e)

### USB_CLASS_WIRELESS_CONTROLLER

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_CLASS_WIRELESS_CONTROLLER
```

USB class for wireless controller devices.

<br />

Constant Value: 224 (0x000000e0)

### USB_DIR_IN

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_DIR_IN
```

Used to signify direction of data for a `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` is IN (device to host)

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getDirection()`

Constant Value: 128 (0x00000080)

### USB_DIR_OUT

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_DIR_OUT
```

Used to signify direction of data for a `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` is OUT (host to device)

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getDirection()`

Constant Value: 0 (0x00000000)

### USB_ENDPOINT_DIR_MASK

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_DIR_MASK
```

Bitmask used for extracting the `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` direction from its address field.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getAddress()`
- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getDirection()`
- `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_DIR_OUT`
- `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_DIR_IN`

Constant Value: 128 (0x00000080)

### USB_ENDPOINT_NUMBER_MASK

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_NUMBER_MASK
```

Bitmask used for extracting the `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` number its address field.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getAddress()`
- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getEndpointNumber()`

Constant Value: 15 (0x0000000f)

### USB_ENDPOINT_XFERTYPE_MASK

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_XFERTYPE_MASK
```

Bitmask used for extracting the `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint` type from its address field.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getAddress()`
- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getType()`
- `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_CONTROL`
- `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_ISOC`
- `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_BULK`
- `https://developer.android.com/reference/android/hardware/usb/UsbConstants#USB_ENDPOINT_XFER_INT`

Constant Value: 3 (0x00000003)

### USB_ENDPOINT_XFER_BULK

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_XFER_BULK
```

Bulk endpoint type

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getType()`

Constant Value: 2 (0x00000002)

### USB_ENDPOINT_XFER_CONTROL

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_XFER_CONTROL
```

Control endpoint type (endpoint zero)

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getType()`

Constant Value: 0 (0x00000000)

### USB_ENDPOINT_XFER_INT

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_XFER_INT
```

Interrupt endpoint type

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getType()`

Constant Value: 3 (0x00000003)

### USB_ENDPOINT_XFER_ISOC

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_ENDPOINT_XFER_ISOC
```

Isochronous endpoint type (currently not supported)

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/usb/UsbEndpoint#getType()`

Constant Value: 1 (0x00000001)

### USB_INTERFACE_SUBCLASS_BOOT

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_INTERFACE_SUBCLASS_BOOT
```

Boot subclass for HID devices.

<br />

Constant Value: 1 (0x00000001)

### USB_SUBCLASS_VENDOR_SPEC

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_SUBCLASS_VENDOR_SPEC
```

Vendor specific USB subclass.

<br />

Constant Value: 255 (0x000000ff)

### USB_TYPE_CLASS

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_TYPE_CLASS
```

Used to specify that an endpoint zero control request is a class specific request.

<br />

Constant Value: 32 (0x00000020)

### USB_TYPE_MASK

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_TYPE_MASK
```

Bitmask used for encoding the request type for a control request on endpoint zero.

<br />

Constant Value: 96 (0x00000060)

### USB_TYPE_RESERVED

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_TYPE_RESERVED
```

Reserved endpoint zero control request type (currently unused).

<br />

Constant Value: 96 (0x00000060)

### USB_TYPE_STANDARD

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_TYPE_STANDARD
```

Used to specify that an endpoint zero control request is a standard request.

<br />

Constant Value: 0 (0x00000000)

### USB_TYPE_VENDOR

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USB_TYPE_VENDOR
```

Used to specify that an endpoint zero control request is a vendor specific request.

<br />

Constant Value: 64 (0x00000040)

## Public constructors

### UsbConstants

```
public UsbConstants ()
```

<br />

<br />