Codota Logo
UsbDevice.getDeviceId
Code IndexAdd Codota 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)

  • Common ways to obtain UsbDevice
private void myMethod () {
UsbDevice u =
  • Codota IconIntent intent;String name;intent.getParcelableExtra(name)
  • Codota IconIntent intent;String name;(UsbDevice) intent.getParcelableExtra(name)
  • Smart code suggestions by Codota
}
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

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now