Example usage for android.hardware.usb UsbEndpoint getAttributes

List of usage examples for android.hardware.usb UsbEndpoint getAttributes

Introduction

In this page you can find the example usage for android.hardware.usb UsbEndpoint getAttributes.

Prototype

public int getAttributes() 

Source Link

Document

Returns the endpoint's attributes field.

Usage

From source file:aws.apps.usbDeviceEnumerator.ui.usbinfo.AndroidUsbInfoFragment.java

private String getEndpointText(final UsbEndpoint endpoint, final int index) {
    final String addressInBinary = CommonLogic.padLeft(Integer.toBinaryString(endpoint.getAddress()), "0", 8);

    String endpointText = "#" + index + "\n";
    endpointText += getString(R.string.address_) + endpoint.getAddress() + " (" + addressInBinary + ")\n";
    endpointText += getString(R.string.number_) + endpoint.getEndpointNumber() + "\n";
    endpointText += getString(R.string.direction_)
            + UsbConstants.resolveUsbEndpointDirection(endpoint.getDirection()) + "\n";
    endpointText += getString(R.string.type_) + UsbConstants.resolveUsbEndpointType(endpoint.getType()) + "\n";
    endpointText += getString(R.string.poll_interval_) + endpoint.getInterval() + "\n";
    endpointText += getString(R.string.max_packet_size_) + endpoint.getMaxPacketSize() + "\n";
    endpointText += getString(R.string.attributes_)
            + CommonLogic.padLeft(Integer.toBinaryString(endpoint.getAttributes()), "0", 8);

    return endpointText;
}