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

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

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

origin: square/assertj-android

public UsbDeviceAssert hasDeviceClass(int value) {
 isNotNull();
 int actualValue = actual.getDeviceClass();
 assertThat(actualValue) //
   .overridingErrorMessage("Expected device class <%s> but was <%s>.", value, actualValue) //
   .isEqualTo(value);
 return this;
}
origin: gigabytedevelopers/FireFiles

private static String nameForClass(UsbDevice usbDevice) {
  int classType = usbDevice.getDeviceClass();
  switch (classType) {
    case UsbConstants.USB_CLASS_AUDIO:
origin: com.squareup.assertj/assertj-android

public UsbDeviceAssert hasDeviceClass(int value) {
 isNotNull();
 int actualValue = actual.getDeviceClass();
 assertThat(actualValue) //
   .overridingErrorMessage("Expected device class <%s> but was <%s>.", value, actualValue) //
   .isEqualTo(value);
 return this;
}
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

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: voroshkov/Chorus-RF-Laptimer

if (mDevice.getDeviceClass() == 0x02) {
  mDeviceType = DEVICE_TYPE_0;
} else {
    if (maxPacketSize0 == 64) {
      mDeviceType = DEVICE_TYPE_HX;
    } else if ((mDevice.getDeviceClass() == 0x00)
        || (mDevice.getDeviceClass() == 0xff)) {
      mDeviceType = DEVICE_TYPE_1;
    } else {
origin: zhouzhuo810/OkUSB

if (mDevice.getDeviceClass() == 0x02) {
  mDeviceType = DEVICE_TYPE_0;
} else {
    if (maxPacketSize0 == 64) {
      mDeviceType = DEVICE_TYPE_HX;
    } else if ((mDevice.getDeviceClass() == 0x00)
        || (mDevice.getDeviceClass() == 0xff)) {
      mDeviceType = DEVICE_TYPE_1;
    } else {
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: NightscoutFoundation/xDrip

if (mDevice.getDeviceClass() == 0x02) {
  mDeviceType = DEVICE_TYPE_0;
} else {
    if (maxPacketSize0 == 64) {
      mDeviceType = DEVICE_TYPE_HX;
    } else if ((mDevice.getDeviceClass() == 0x00)
        || (mDevice.getDeviceClass() == 0xff)) {
      mDeviceType = DEVICE_TYPE_1;
    } else {
origin: jamorham/xDrip-plus

if (mDevice.getDeviceClass() == 0x02) {
  mDeviceType = DEVICE_TYPE_0;
} else {
    if (maxPacketSize0 == 64) {
      mDeviceType = DEVICE_TYPE_HX;
    } else if ((mDevice.getDeviceClass() == 0x00)
        || (mDevice.getDeviceClass() == 0xff)) {
      mDeviceType = DEVICE_TYPE_1;
    } else {
origin: demantz/hackrf_android

    + ". Vendor ID: " + usbDevice.getVendorId() + " Product ID: " + usbDevice.getProductId());
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: alt236/USB-Device-Info---Android

private void populateDataTable(LayoutInflater inflater) {
  final String vid = padLeft(Integer.toHexString(device.getVendorId()), "0", 4);
  final String pid = padLeft(Integer.toHexString(device.getProductId()), "0", 4);
  final String deviceClass = UsbConstantResolver.resolveUsbClass(device.getDeviceClass());
origin: kshoji/USB-MIDI-Driver

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

Popular methods of UsbDevice

  • getVendorId
  • getProductId
  • getDeviceName
  • getInterfaceCount
  • getInterface
  • getDeviceId
  • 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 plugins for Android Studio
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