Example usage for android.hardware.usb UsbConstants USB_TYPE_CLASS

List of usage examples for android.hardware.usb UsbConstants USB_TYPE_CLASS

Introduction

In this page you can find the example usage for android.hardware.usb UsbConstants USB_TYPE_CLASS.

Prototype

int USB_TYPE_CLASS

To view the source code for android.hardware.usb UsbConstants USB_TYPE_CLASS.

Click Source Link

Document

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

Usage

From source file:org.chromium.ChromeUsb.java

private static int controlRequestTypeFromName(String requestType) throws UsbError {
    requestType = requestType.toLowerCase();
    if ("standard".equals(requestType)) {
        return UsbConstants.USB_TYPE_STANDARD; /* 0x00 */
    } else if ("class".equals(requestType)) {
        return UsbConstants.USB_TYPE_CLASS; /* 0x20 */
    } else if ("vendor".equals(requestType)) {
        return UsbConstants.USB_TYPE_VENDOR; /* 0x40 */
    } else if ("reserved".equals(requestType)) {
        return UsbConstants.USB_TYPE_RESERVED; /* 0x60 */
    } else {//from  w  w  w. j a  va2s.c o  m
        throw new UsbError("Unknown transfer requestType: " + requestType);
    }
}