Codota Logo
UsbDevice.getDeviceProtocol
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using android.hardware.usb.UsbDevice.getDeviceProtocol (Showing top 10 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 hasDeviceProtocol(int protocol) {
 isNotNull();
 int actualProtocol = actual.getDeviceProtocol();
 assertThat(actualProtocol) //
   .overridingErrorMessage("Expected device protocol <%s> but was <%s>.", protocol,
     actualProtocol) //
   .isEqualTo(protocol);
 return this;
}
origin: com.squareup.assertj/assertj-android

public UsbDeviceAssert hasDeviceProtocol(int protocol) {
 isNotNull();
 int actualProtocol = actual.getDeviceProtocol();
 assertThat(actualProtocol) //
   .overridingErrorMessage("Expected device protocol <%s> but was <%s>.", protocol,
     actualProtocol) //
   .isEqualTo(protocol);
 return this;
}
origin: Car-eye-team/Car-eye-device

if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action) && device.getDeviceProtocol() ==1) {          
  Toast.makeText(context, "监听到usb摄像头变动1"+device.getDeviceProtocol(), Toast.LENGTH_LONG).show();
  usbcameraConnect = false;    
  closeCamera(0);   		 
} else if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action) && device.getDeviceProtocol()==1) {
  Toast.makeText(context, "监听到usb摄像头变动0"+device.getDeviceProtocol(), Toast.LENGTH_LONG).show();
  try {
    Thread.sleep(500);
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: demantz/hackrf_android

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

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

Popular methods of UsbDevice

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

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
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