Reputation: 14975
I see this interface subclass specified in the device filter of the USB Host documentation but the int is also not defined in the UsbConstants documentation.
There are two scenarios in which I plug in USB.
In one, my application is running in the foreground on the dev board (running android 4.x). When I plug in the USB, I receive the action
android.hardware.usb.action.USB_DEVICE_ATTACHED
and I print out the device interface I get
Interface: UsbInterface[mId=0,mClass=255,mSubclass=66,mProtocol=1,mEndpoints=[Landroid.os.Parcelable;@418044c0]
In the other, the application is closed. When I plug in the device and accept the prompt I receive the attached action and print out the interface list, which appears to have two devices
Interface: UsbInterface[mId=0,mClass=255,mSubclass=255,mProtocol=0,mEndpoints=[Landroid.os.Parcelable;@417496c8]
Interface: UsbInterface[mId=1,mClass=255,mSubclass=66,mProtocol=1,mEndpoints=[Landroid.os.Parcelable;@417498b0]
So, what is mSubclass 66 (I know 255 is UsbConstants.USB_CLASS_VENDER_SPEC
, which I believe is my USB Accessory), and why do the two different scenarios produce two different results?
Upvotes: 3
Views: 1956
Reputation: 2653
Because the class of your device is vendor specific it is up to the vendor to define the subclass, so there won't be anything defined by usb.org. You should look up the vendor of your device if you want more information (you can find the vendor from the VID in the device descriptor).
If you see that one of the interfaces is missing when your application is opened it's possible that it has a handle opened on the device already and you cannot access it.
Upvotes: 1