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

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

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

origin: square/assertj-android

public UsbDeviceAssert hasDeviceSubclass(int subclass) {
 isNotNull();
 int actualSubclass = actual.getDeviceSubclass();
 assertThat(actualSubclass) //
   .overridingErrorMessage("Expected device subclass <%s> but was <%s>.", subclass,
     actualSubclass) //
   .isEqualTo(subclass);
 return this;
}
origin: com.squareup.assertj/assertj-android

public UsbDeviceAssert hasDeviceSubclass(int subclass) {
 isNotNull();
 int actualSubclass = actual.getDeviceSubclass();
 assertThat(actualSubclass) //
   .overridingErrorMessage("Expected device subclass <%s> but was <%s>.", subclass,
     actualSubclass) //
   .isEqualTo(subclass);
 return this;
}
origin: NightscoutFoundation/xDrip

static public boolean isG4Connected(Context c){
  UsbManager manager = (UsbManager) c.getSystemService(Context.USB_SERVICE);
  HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
  Log.i("USB DEVICES = ", deviceList.toString());
  Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
  Log.i("USB DEVICES = ", String.valueOf(deviceList.size()));
  while(deviceIterator.hasNext()){
    UsbDevice device = deviceIterator.next();
    if (device.getVendorId() == 8867 && device.getProductId() == 71
        && device.getDeviceClass() == 2 && device.getDeviceSubclass() ==0
        && device.getDeviceProtocol() == 0){
      Log.i("CALIBRATION-CHECK-IN: ", "Dexcom Found!");
      return true;
    }
  }
  return false;
}
origin: jamorham/xDrip-plus

static public boolean isG4Connected(Context c){
  UsbManager manager = (UsbManager) c.getSystemService(Context.USB_SERVICE);
  HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
  Log.i("USB DEVICES = ", deviceList.toString());
  Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
  Log.i("USB DEVICES = ", String.valueOf(deviceList.size()));
  while(deviceIterator.hasNext()){
    UsbDevice device = deviceIterator.next();
    if (device.getVendorId() == 8867 && device.getProductId() == 71
        && device.getDeviceClass() == 2 && device.getDeviceSubclass() ==0
        && device.getDeviceProtocol() == 0){
      Log.i("CALIBRATION-CHECK-IN: ", "Dexcom Found!");
      return true;
    }
  }
  return false;
}
origin: NightscoutFoundation/xDrip

public UsbDevice findDexcom() {
  Log.i("CALIBRATION-CHECK-IN: ", "Searching for dexcom");
  mUsbManager = (UsbManager) getApplicationContext().getSystemService(Context.USB_SERVICE);
  Log.i("USB MANAGER = ", mUsbManager.toString());
  HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
  Log.i("USB DEVICES = ", deviceList.toString());
  Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
  Log.i("USB DEVICES = ", String.valueOf(deviceList.size()));
  while(deviceIterator.hasNext()){
    UsbDevice device = deviceIterator.next();
    if (device.getVendorId() == 8867 && device.getProductId() == 71
        && device.getDeviceClass() == 2 && device.getDeviceSubclass() ==0
        && device.getDeviceProtocol() == 0){
      dexcom = device;
      Log.i("CALIBRATION-CHECK-IN: ", "Dexcom Found!");
      return device;
    } else {
      Log.w("CALIBRATION-CHECK-IN: ", "that was not a dexcom (I dont think)");
    }
  }
  return null;
}
origin: jamorham/xDrip-plus

public UsbDevice findDexcom() {
  Log.i("CALIBRATION-CHECK-IN: ", "Searching for dexcom");
  mUsbManager = (UsbManager) getApplicationContext().getSystemService(Context.USB_SERVICE);
  Log.i("USB MANAGER = ", mUsbManager.toString());
  HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
  Log.i("USB DEVICES = ", deviceList.toString());
  Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
  Log.i("USB DEVICES = ", String.valueOf(deviceList.size()));
  while(deviceIterator.hasNext()){
    UsbDevice device = deviceIterator.next();
    if (device.getVendorId() == 8867 && device.getProductId() == 71
        && device.getDeviceClass() == 2 && device.getDeviceSubclass() ==0
        && device.getDeviceProtocol() == 0){
      dexcom = device;
      Log.i("CALIBRATION-CHECK-IN: ", "Dexcom Found!");
      return device;
    } else {
      Log.w("CALIBRATION-CHECK-IN: ", "that was not a dexcom (I dont think)");
    }
  }
  return null;
}
origin: androidthings/sample-usbenum

/**
 * Enumerate the endpoints and interfaces on the connected device.
 *
 * @param device Device to query.
 * @return String description of the device configuration.
 */
public static String readDevice(UsbDevice device) {
  StringBuilder sb = new StringBuilder();
  sb.append("Device Name: " + device.getDeviceName() + "\n");
  sb.append(String.format(
      "Device Class: %s -> Subclass: 0x%02x -> Protocol: 0x%02x\n",
      nameForClass(device.getDeviceClass()),
      device.getDeviceSubclass(), device.getDeviceProtocol()));
  for (int i = 0; i < device.getInterfaceCount(); i++) {
    UsbInterface intf = device.getInterface(i);
    sb.append(String.format(Locale.US,
        "-- Interface %d Class: %s -> Subclass: 0x%02x -> Protocol: 0x%02x\n",
        intf.getId(),
        nameForClass(intf.getInterfaceClass()),
        intf.getInterfaceSubclass(),
        intf.getInterfaceProtocol()));
    sb.append(String.format(Locale.US, "   -- Endpoint Count: %d\n",
        intf.getEndpointCount()));
  }
  return sb.toString();
}
origin: felHR85/UsbSerial

device.getVendorId(), device.getProductId(),
UsbSerialDevice.isSupported(device),
device.getDeviceClass(), device.getDeviceSubclass(),
device.getDeviceName()));
origin: felHR85/UsbSerial

device.getVendorId(), device.getProductId(),
UsbSerialDevice.isSupported(device),
device.getDeviceClass(), device.getDeviceSubclass(),
device.getDeviceName()));
origin: felHR85/UsbSerial

device.getVendorId(), device.getProductId(),
UsbSerialDevice.isSupported(device),
device.getDeviceClass(), device.getDeviceSubclass(),
device.getDeviceName()));
origin: demantz/hackrf_android

Log.i(logTag,"constructor: device protocol: " + usbDevice.getDeviceProtocol());
Log.i(logTag,"constructor: device class: " + usbDevice.getDeviceClass()
    + " subclass: " + usbDevice.getDeviceSubclass());
Log.i(logTag,"constructor: interface count: " + usbDevice.getInterfaceCount());
origin: kshoji/USB-MIDI-Driver

if (matches(device.getDeviceClass(), device.getDeviceSubclass(), device.getDeviceProtocol())) {
  return true;
android.hardware.usbUsbDevicegetDeviceSubclass

Popular methods of UsbDevice

  • getVendorId
  • getProductId
  • getDeviceName
  • getInterfaceCount
  • getInterface
  • getDeviceClass
  • getDeviceId
  • 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
  • Best plugins for Eclipse
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