什么是USB接口子类66?(What is USB Interface Subclass 66?)

编程入门 行业动态 更新时间:2024-10-26 15:18:43
什么是USB接口子类66?(What is USB Interface Subclass 66?)

我在USB Host文档的设备过滤器中看到了这个接口子类,但是在UsbConstants文档中也没有定义int。

有两种情况我可以插入USB。

在一个,我的应用程序在开发板的前台运行(运行android 4.x)。 当我插入USB时,我收到了动作

android.hardware.usb.action.USB_DEVICE_ATTACHED

然后我打印出我得到的设备界面

Interface: UsbInterface[mId=0,mClass=255,mSubclass=66,mProtocol=1,mEndpoints=[Landroid.os.Parcelable;@418044c0]

在另一方面,申请被关闭。 当我插入设备并接受提示时,我收到附加的操作并打印出界面列表,该列表似乎有两个设备

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]

那么,什么是mSubclass 66(我知道255是UsbConstants.USB_CLASS_VENDER_SPEC ,我认为是我的USB附件),为什么这两种不同的场景会产生两种不同的结果呢?

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?

最满意答案

因为您的设备的类是特定于供应商的,所以由供应商来定义子类,因此usb.org不会定义任何内容。 如果需要更多信息,可以查找设备的供应商(可以在设备描述符中找到VID中的供应商)。

如果您在打开应用程序时看到其中一个接口丢失,则可能是它已在设备上打开了一个句柄,您无法访问它。

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.

更多推荐

本文发布于:2023-07-16 07:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125530.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:子类   接口   USB   Subclass   Interface

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!