Example usage for android.hardware.usb UsbEndpoint getEndpointNumber

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

Introduction

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

Prototype

public int getEndpointNumber() 

Source Link

Document

Extracts the endpoint's endpoint number from its address

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;
}