Example usage for android.hardware.usb UsbEndpoint getAddress

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

Introduction

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

Prototype

public int getAddress() 

Source Link

Document

Returns the endpoint's address 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;
}