Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UsbManager manager = (UsbManager) xCtx.getSystemService(Context.USB_SERVICE);
- HashMap<String, UsbDevice> devices = manager.getDeviceList();
- Iterator<String> iterator = devices.keySet().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- FusionInventory.log(this,key, Log.VERBOSE);
- UsbDevice mydevice = devices.get(key);
- Category c = new Category(mCtx, "USBDEVICES");
- c.put("CLASS", Integer.toString(mydevice.getDeviceClass()));
- c.put("PRODUCTID", Integer.toString(mydevice.getProductId()));
- c.put("VENDORID", Integer.toString(mydevice.getVendorId()));
- c.put("SUBCLASS", Integer.toString(mydevice.getDeviceSubclass()));
- this.add(c);
- }
Advertisement
Add Comment
Please, Sign In to add comment