UsbInterface null except for one device

This method I found a solution to find out if the connected device is a storage device.

I am following this point to understand how a USB connection to a storage device is made. But the main problem that I encountered is that for the whole connected device, except for the last connected device, I do not get UsbInterface and therefore related UsbEndPoints. Now, how can I recognize all other connected storage devices.

When 3 devices are connected, I received:

found usb device: UsbDevice[ mName=/dev/bus/usb/001/009, mVendorId=1423, mProductId=25479, mClass=0, mSubclass=0, mProtocol=0, mManufacturerName=Generic, mProductName=Mass Storage, mSerialNumber=EE44CC66, mConfigurations=[UsbConfiguration[mId=1,mName=null,mAttributes=128,mMaxPower=100, mInterfaces=[ UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=8,mSubclass=6,mProtocol=80, mEndpoints=[ UsbEndpoint[mAddress=1,mAttributes=2,mMaxPacketSize=512,mInterval=0] UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0] ] ] ] found usb device: UsbDevice[ mName=/dev/bus/usb/001/003, mVendorId=3141, mProductId=21236, mClass=0, mSubclass=0, mProtocol=0, mManufacturerName=AliTV Remote V1, mProductName=Airmouse, mSerialNumber=null, mConfigurations=[UsbConfiguration[mId=1,mName=null,mAttributes=160,mMaxPower=50, mInterfaces=[] ] found usb device: UsbDevice[ mName=/dev/bus/usb/001/007, mVendorId=1423, mProductId=25479, mClass=0, mSubclass=0, mProtocol=0, mManufacturerName=Generic, mProductName=Mass Storage, mSerialNumber=94012721, mConfigurations=[UsbConfiguration[mId=1,mName=null,mAttributes=128,mMaxPower=100, mInterfaces=[] ] 
+1
source share

Source: https://habr.com/ru/post/918768/


All Articles