问题
This way I found solution to recognize if the connected device is storage device.
I am following this thesis to understand how the USB Communication with Storage device is done. But the main problem I faced is that For all the connected device except the last connected device I am not getting the UsbInterface and so the related UsbEndPoints. Now How can I recognize all other connected storage device.
When 3 devices are connected the log I got is:
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=[]
]
来源:https://stackoverflow.com/questions/42088660/usbinterface-null-for-except-1-device