Tabnine Logo
UsbDevice.getDeviceId
Code IndexAdd Tabnine to your IDE (free)

How to use
getDeviceId
method
in
android.hardware.usb.UsbDevice

Best Java code snippets using android.hardware.usb.UsbDevice.getDeviceId (Showing top 14 results out of 315)

origin: square/assertj-android

public UsbDeviceAssert hasDeviceId(int id) {
 isNotNull();
 int actualId = actual.getDeviceId();
 assertThat(actualId) //
   .overridingErrorMessage("Expected device id <%s> but was <%s>.", id, actualId) //
   .isEqualTo(id);
 return this;
}
origin: felHR85/UsbSerial

  @Override
  public boolean equals(Object obj) {
    UsbDeviceStatus usbDeviceStatus= (UsbDeviceStatus) obj;
    return usbDeviceStatus.usbDevice.getDeviceId() == usbDevice.getDeviceId();
  }
}
origin: felHR85/UsbSerial

public int getDeviceId(){
  return device.getDeviceId();
}
origin: gigabytedevelopers/FireFiles

private String getRootId(UsbDevice usbDevice) {
  return ROOT_ID_USB + Integer.toString(usbDevice.getDeviceId());
}
origin: jamorham/xDrip-plus

@Override
public String toString() {
  return String.format("<%s device_name=%s device_id=%s port_number=%s>",
      getClass().getSimpleName(), mDevice.getDeviceName(),
      mDevice.getDeviceId(), mPortNumber);
}
origin: NightscoutFoundation/xDrip

@Override
public String toString() {
  return String.format("<%s device_name=%s device_id=%s port_number=%s>",
      getClass().getSimpleName(), mDevice.getDeviceName(),
      mDevice.getDeviceId(), mPortNumber);
}
origin: voroshkov/Chorus-RF-Laptimer

@Override
public String toString() {
  return String.format("<%s device_name=%s device_id=%s port_number=%s>",
      getClass().getSimpleName(), mDevice.getDeviceName(),
      mDevice.getDeviceId(), mPortNumber);
}
origin: stackoverflow.com

UsbManager usbManager = (UsbManager) getSystemService(USB_SERVICE);
HashMap<String, UsbDevice> devicelist = usbManager.getDeviceList();
Iterator<UsbDevice> deviceIterator = devicelist.values().iterator();
while(deviceIterator.hasNext()) {
 UsbDevice usbDevice = deviceIterator.next();
 Log.i(Log_Tag, "Model     : " +usbDevice.getDeviceName());
 Log.i(Log_Tag, "Id        : " +usbDevice.getDeviceId());
}
origin: zhouzhuo810/OkUSB

@Override
public String toString() {
  return String.format("<%s device_name=%s device_id=%s port_number=%s>",
      getClass().getSimpleName(), mDevice.getDeviceName(),
      mDevice.getDeviceId(), mPortNumber);
}
origin: com.squareup.assertj/assertj-android

public UsbDeviceAssert hasDeviceId(int id) {
 isNotNull();
 int actualId = actual.getDeviceId();
 assertThat(actualId) //
   .overridingErrorMessage("Expected device id <%s> but was <%s>.", id, actualId) //
   .isEqualTo(id);
 return this;
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Delete HVC-P Device.
 * @param device device
 */
public void removeUSBDevice(final UsbDevice device) {
  HVCCameraInfo camera = mServices.remove("" + device.getDeviceId() + "_" + device.getProductId() + "_" + device.getVendorId());
  if (camera != null) {
    // デバイスとの接続切断を通知.
    notifyOnDisconnected(camera);
  }
}
origin: DeviceConnect/DeviceConnect-Android

  @Override
  public void onReceive(Context context, Intent intent) {
    if (intent == null) {
      return;
    }
    String action = intent.getAction();
    if (BuildConfig.DEBUG) {
      Log.d(TAG, "action:" + action);
    }
    UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
    if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
      HVCCameraInfo camera = new HVCCameraInfo("" + device.getDeviceId() + "_" + device.getProductId() + "_" + device.getVendorId(),
              "HVC-P:" + "" + device.getDeviceId() + "_" + device.getProductId() + "_" + device.getVendorId());
      mServices.put(camera.getID(), camera);
      // デバイスとの接続完了を通知.
      notifyOnConnected(camera);
      HVCManager.INSTANCE.init(context);
      if (BuildConfig.DEBUG) {
        Log.d(TAG, "device:true:" + device.getDeviceId());
      }
    } else {
      if (BuildConfig.DEBUG) {
        Log.d(TAG, "device:false");
      }
    }
  }
};
origin: felHR85/UsbSerial

public boolean disconnectDevice(UsbDevice usbDevice){
  Optional<UsbSerialDevice> optionalDevice = Stream.of(serialDevices)
      .filter(p -> usbDevice.getDeviceId() == p.getDeviceId())
      .findSingle();
  if(optionalDevice.isPresent()){
    UsbSerialDevice disconnectedDevice = optionalDevice.get();
    disconnectedDevice.syncClose();
    serialDevices = Utils.removeIf(serialDevices, p -> usbDevice.getDeviceId() == p.getDeviceId());
    return true;
  }
  return false;
}
origin: kshoji/USB-MIDI-Driver

@NonNull
@Override
public Info getDeviceInfo() {
  if (cachedInfo != null) {
    return cachedInfo;
  }
  UsbDevice usbDevice = null;
  for (final MidiInputDevice midiInputDevice : transmitters.keySet()) {
    usbDevice = midiInputDevice.getUsbDevice();
    break;
  }
  if (usbDevice == null) {
    for (final MidiOutputDevice midiOutputDevice : receivers.keySet()) {
      usbDevice = midiOutputDevice.getUsbDevice();
      break;
    }
  }
  if (usbDevice == null) {
    // XXX returns `null` information
    return cachedInfo = new Info("(null)", "(null)", "(null)", "(null)");
  }
  return cachedInfo = new Info(usbDevice.getDeviceName(), //
      String.format("vendorId: %x, productId: %x", usbDevice.getVendorId(), usbDevice.getProductId()), //
      "deviceId:" + usbDevice.getDeviceId(), //
      usbDevice.getDeviceName());
}
android.hardware.usbUsbDevicegetDeviceId

Popular methods of UsbDevice

  • getVendorId
  • getProductId
  • getDeviceName
  • getInterfaceCount
  • getInterface
  • getDeviceClass
  • getDeviceSubclass
  • getDeviceProtocol
  • equals
  • getProductName
  • getManufacturerName
  • toString
  • getManufacturerName,
  • toString,
  • getConfiguration,
  • getConfigurationCount

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now