public UsbEndpointAssert hasAddress(int address) { isNotNull(); int actualAddress = actual.getAddress(); assertThat(actualAddress) // .overridingErrorMessage("Expected address <%s> but was <%s>.", address, actualAddress) // .isEqualTo(address); return this; }
public UsbEndpointAssert hasAddress(int address) { isNotNull(); int actualAddress = actual.getAddress(); assertThat(actualAddress) // .overridingErrorMessage("Expected address <%s> but was <%s>.", address, actualAddress) // .isEqualTo(address); return this; }
@Override public RemoteClockInfo syncClock() throws IOException { if (!isConnected()) { throw new IOException("Not connected to WALT"); } try { int fd = usbConnection.getFileDescriptor(); int ep_out = endpointOut.getAddress(); int ep_in = endpointIn.getAddress(); remoteClock.baseTime = syncClock(fd, ep_out, ep_in); remoteClock.minLag = 0; remoteClock.maxLag = getMaxE(); } catch (Exception e) { logger.log("Exception while syncing clocks: " + e.getStackTrace()); } logger.log("Synced clocks, maxE=" + remoteClock.maxLag + "us"); Log.i(TAG, remoteClock.toString()); return remoteClock; }
private String getEndpointText(final UsbEndpoint endpoint, final int index) { final String addressInBinary = padLeft(Integer.toBinaryString(endpoint.getAddress()), "0", 8); final String addressInHex = padLeft(Integer.toHexString(endpoint.getAddress()), "0", 2); final String attributesInBinary = padLeft(Integer.toBinaryString(endpoint.getAttributes()), "0", 8); String endpointText = "#" + index + "\n"; endpointText += getString(R.string.address_) + "0x" + addressInHex + " (" + addressInBinary + ")\n"; endpointText += getString(R.string.number_) + endpoint.getEndpointNumber() + "\n"; endpointText += getString(R.string.direction_) + UsbConstantResolver.resolveUsbEndpointDirection(endpoint.getDirection()) + "\n"; endpointText += getString(R.string.type_) + UsbConstantResolver.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_) + attributesInBinary; return endpointText; }
UsbEndpoint currentEndpoint = usbInterface.getEndpoint(i); switch (currentEndpoint.getAddress()) { case READ_ENDPOINT: mReadEndpoint = currentEndpoint;
UsbEndpoint currentEndpoint = usbInterface.getEndpoint(i); switch (currentEndpoint.getAddress()) { case READ_ENDPOINT: mReadEndpoint = currentEndpoint;
Log.i(logTag,"constructor: [endpoint 0 (IN)] address: " + usbEndpointIN.getAddress() + " attributes: " + usbEndpointIN.getAttributes() + " direction: " + usbEndpointIN.getDirection() + " max_packet_size: " + usbEndpointIN.getMaxPacketSize()); Log.i(logTag,"constructor: [endpoint 1 (OUT)] address: " + usbEndpointOUT.getAddress() + " attributes: " + usbEndpointOUT.getAttributes() + " direction: " + usbEndpointOUT.getDirection() + " max_packet_size: " + usbEndpointOUT.getMaxPacketSize());
UsbEndpoint currentEndpoint = usbInterface.getEndpoint(i); switch (currentEndpoint.getAddress()) { case READ_ENDPOINT: mReadEndpoint = currentEndpoint;
UsbEndpoint currentEndpoint = usbInterface.getEndpoint(i); switch (currentEndpoint.getAddress()) { case READ_ENDPOINT: mReadEndpoint = currentEndpoint;
for (int i = 0; i < usbInterface.getEndpointCount(); i++) { UsbEndpoint ep = usbInterface.getEndpoint(i); if (readEndpoint == null && ep.getType() == UsbConstants.USB_ENDPOINT_XFER_INT && ep.getAddress() == 0x81) { // number = 1 ; dir = USB_DIR_IN readEndpoint = ep; continue; if (writeEndpoint == null && ep.getType() == UsbConstants.USB_ENDPOINT_XFER_INT && (ep.getAddress() == 0x01 || ep.getAddress() == 0x02)) { // number = 1 ; dir = USB_DIR_OUT writeEndpoint = ep;