USB设备类型汇总

USB设备类型汇总

一、USB概述

1.USB 版本

在这里插入图片描述

2.USB 接口

在这里插入图片描述

3.USB Class Codes

USB定义了设备类的类别码信息,它的功能包括:可以用来识别设备并且加载设备驱动。这种代码信息有包含Base Class([基类])、SubClass([子类])、Protocol([协议])一共占有3个字节。

Base Class、SubClass与Protocol详细关系列表

在这里插入图片描述

4.USB封包格式

在这里插入图片描述

二、常见usb设备类型

参考ACM&ECM&NCM&EEM&RNDIS&RmNet介绍

1.USB CDC设备

通用串行总线(USB)通信设备(Communication devices)的定义由三个类组成:

  • 通信设备类(Communication Device Class, CDC):设备级定义,被主机用于识别(确定)含有几种不同类型接口的通信设备;
  • 通信接口类(Communication Interface Class):定义了一种通用机制,该机制可被用来使能处于USB总线上的所有类型的通信服务,即USB通信设备的控制功能;
  • 数据接口类(Data Interface Class):定义了一种通用机制,当一种数据不符合任何类的要求时,该机制使这种数据传输能通过USB块传输或同步传输类型在USB总线上进行,即通过USB块传输或同步传输类型去实现任何类型的数据传输的机制。
1)USB CDC ACM(虚拟串口)
  • CDC-ACM (Abstract Control Model 抽象控制模型)允许任何通信设备提供串行通信接口(例如发送和接收AT命令的调制解调器设备)。该设备类型是在PSTN(Public Switched Telephone Network)中定义的。
  • CDC-ACM驱动程序将USB设备作为虚拟调制解调器或虚拟COM端口暴露给操作系统。驱动程序可以通过ACM(通过不同通道分离数据和AT命令)或通过串行仿真(按原样传递AT命令和作为数据流的一部分)发送数据和AT命令。
2)USB CDC ECM

CDC-ECM(Ethernet Networking Control Model 以太网网络控制模型)用于在设备和主机之间交换以太网帧数据。CDC-ECM设备的一般用例是LAN/WLAN的点对点以太网适配器。(获取的是局域网IP)

3)USB CDC NCM

CDC-NCM(Network Control Model 网络控制模型)协议用于在设备和主机之间交换高速以太网帧数据。这些以太网帧可以传送通过通信网络传输的IPv4或IPv6数据报。NCM设备的一般用例是支持3.5G/4G网络的无线网络适配器,例如:HSPA +和LTE。NCM是建立在ECM的基础上,进行改进以支持更高的数据速率,主要表现在

  • 多个以太网帧可以聚合为单个USB传输;
  • 为了最大限度地减少在USB设备中处理以太网帧时的开销,CDC-NCM可以按照最好的方式将以太网帧放到USB传输中。
  • CDC-ECM专为USB full-speed设备而设计,尤其适用于支持DOCSIS 1.0电缆调制解调器。虽然ECM在功能上是完整的,但它在吞吐量或效率方面不能很好地扩展到更高的USB速度和更高的网络速度。NCM利用从ECM实施中获得的经验,并调整数据传输协议,使其更加高效。
4)USB CDC EEM

CDC-EEM(Ethernet Emulation Model 以太网仿真模型)是一种通过USB总线以低成本和高效率传输以太网帧的规范。CDC ECM不同,EEM不会扩展USB总线上的接口,而是将USB总线视为移动以太网数据包的工具。EEM是较新的标准,比ECM稍微简单一些,可以获得更多的硬件支持。两者之间的差别是:

  • ECM将网络接口扩展到目标(例如USB电缆调制解调器);
  • EEM用于移动设备通过USB使用以太网与主机通信。

但是,对于Linux gadget,与主机的接口是相同的(usbX设备),因此差异很小。

5)USB CDC OBEX

USB CDC-OBEX(Object Exchange 对象交换)符合WMC(Wireless Mobile Communication 无线移动通信)OBEX功能模型,支持USB上的OBEX应用程序。

6)USB WMC

USB WMC(Wireless Mobile Communication 无线移动通信),可以理解为USB上网卡(连接移动通信网络),该模型包括以下内容:

在这里插入图片描述

2.RNDIS设备

  • RNDIS(Remote Network Driver Interface Specification 远程网络驱动接口协议)是Microsoft专有协议,主要用于USB之上,在支持Microsoft RNDIS协议的Windows PC上提供类似CDC的通信功能。它提供了大多数Windows,Linux和FreeBSD操作系统版本的虚拟以太网链接。

  • NDISRNDIS区别:NDIS是一种规范,定义了网络驱动接口的api。RNDIS是一种技术,是将TCP/IP封装在USB报文里,实现网络通信。

  • NDISPPP区别:ppp通过pppd进行拨号,NDIS通过gobinet进行拨号。

  • RNDIS的框架如下:

在这里插入图片描述

3.RmNet设备

RmNet是高通公司为其手机平台开发的专有USB虚拟以太网框架。 RmNet通过薄层协议(TLP)提供更高的吞吐量,并允许服务质量流量控制。

  • RmNetCDC-ECM区别:更像是两种拨号方式的区别,RmNet获取公网IP,CCD-ECM获取局域网IP。
  • 在高通平台上,rmnet 也是属于CDC-ECM,他们具体的区别在于对于USB命令的封装以及使用的USB接口,端点定义方式不同。
  • 如果是使用RmNet,那么发起data call是通过QMI工具发的QMI命令,QMI工具为QMICM,QMICM集成了QMI命令。
  • 而通过标准的CDC-ECM发起data call,则是发送标准的ECM命令。
    • 如果是QMICM建立的data call,不走router的,所以它的IP地址获得的是公网IP。
    • 而通过标准的CDC-ECM建立的data call,是走router的,获得的IP地址是私有的IP如192.168开头。

4.HID设备

Human Interface Device的缩写,由其名称可以了解HID设备是直接与人交互的设备,例如键盘、鼠标与游戏杆等。不过HID设备并不一定要有人机接口,只要符合HID类别规范的设备都是HID设备。

5.Mass Storage设备

USB大容量存储设备是一个协议,允许一个USB接口的设备与主计算设备相连接,以便在两者之间传输文件。对于主计算设备来说,USB设备看起来就像一个移动硬盘,允许拖放型文件传送。它实际上是由USB实施者论坛所通过许多通讯协议的汇总,这一标准提供了许多设备的界面。包括移动硬盘、闪存盘、移动光学驱动器、读卡器数码相机、数码音乐播放器、PDA以及手机等等。

Defined Class Codes

USB defines class code information that is used to identify a device’s functionality and to nominally load a device driver based on that functionality. The information is contained in three bytes with the names Base Class, SubClass, and Protocol. (Note that ‘Base Class’ is used in this description to identify the first byte of the Class Code triple. That terminology is not used in the USB Specification). There are two places on a device where class code information can be placed.One place is in the Device Descriptor, and the other is in Interface Descriptors. Some defined class codes are allowed to be used only in a Device Descriptor, others can be used in both Device and Interface Descriptors, and some can only be used in Interface Descriptors. The table below shows the currently defined set of Base Class values, what the generic usage is, and where that Base Class can be used (either Device or Interface Descriptors or both).

Last Update: June 15, 2016

Base ClassDescriptor UsageDescription
00hDeviceUse class information in the Interface Descriptors
01hInterfaceAudio
02hBothCommunications and CDC Control
03hInterfaceHID (Human Interface Device)
05hInterfacePhysical
06hInterfaceImage
07hInterfacePrinter
08hInterfaceMass Storage
09hDeviceHub
0AhInterfaceCDC-Data
0BhInterfaceSmart Card
0DhInterfaceContent Security
0EhInterfaceVideo
0FhInterfacePersonal Healthcare
10hInterfaceAudio/Video Devices
11hDeviceBillboard Device Class
12hInterfaceUSB Type-C Bridge Class
DChBothDiagnostic Device
E0hInterfaceWireless Controller
EFhBothMiscellaneous
FEhInterfaceApplication Specific
FFhBothVendor Specific

Base Class 00h (Device)

This base class is defined to be used in Device Descriptors to indicate that class information should be determined from the Interface Descriptors in the device. There is one class code definition in this base class. All other values are reserved.

This value is also used in Interface Descriptors to indicate a null class code triple.

Base ClassSubClassProtocolMeaning
00h00h00hUse class code info from Interface Descriptors

Base Class 01h (Audio)

This base class is defined for Audio capable devices that conform to the Audio Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes may only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
01hxxhxxhAudio device

Base Class 02h (Communications and CDC Control)

This base class is defined for devices that conform to the Communications Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. Note that the Communication Device Class spec requires some class code values (triples) to be used in Device Descriptors and some to be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
02hxxhxxhCommunication device class

Base Class 03h (HID – Human Interface Device)

This base class is defined for devices that conform to the HID Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
03hxxhxxhHID device class

Base Class 05h (Physical)

This base class is defined for devices that conform to the Physical Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
05hxxhxxhPhysical device class

Base Class 06h (Still Imaging)

This base class is defined for devices that conform to the Imaging Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved.

Base ClassSubClassProtocolMeaning
06h01h01hStill Imaging device

Base Class 07h (Printer)

This base class is defined for devices that conform to the Printer Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
07hxxhxxhPrinter device

Base Class 08h (Mass Storage)

This base class is defined for devices that conform to the Mass Storage Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
08hxxhxxhMass Storage device

Base Class 09h (Hub)

This base class is defined for devices that are USB hubs and conform to the definition in the USB specification. That specification defines the complete triples as shown below. All other values are reserved. These class codes can only be used in Device Descriptors.

Base ClassSubClassProtocolMeaning
09h00h00hFull speed Hub
01hHi-speed hub with single TT
02hHi-speed hub with multiple TTs

Base Class 0Ah (CDC-Data)

This base class is defined for devices that conform to the Communications Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values.Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
0AhxxhxxhCDC data device

Base Class 0Bh (Smart Card)

This base class is defined for devices that conform to the Smart Card Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values.Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
0BhxxhxxhSmart Card device

Base Class 0Dh (Content Security)

This base class is defined for devices that conform to the Content Security Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
0Dh00h00hContent Security device

Base Class 0Eh (Video)

This base class is defined for devices that conform to the Video Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
0EhxxhxxhVideo device

Base Class 0Fh (Personal Healthcare)

This base class is defined for devices that conform to the Personal Healthcare Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes should only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
0FhxxhxxhPersonal Healthcare device

Base Class 10h (Audio/Video Devices)

The USB Audio/Video (AV) Device Class Definition describes the methods used to communicate with devices or functions embedded in composite devices that are used to manipulate audio, video, voice, and all image- and sound-related functionality. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
10h01h00hAudio/Video Device – AVControl Interface
02h00hAudio/Video Device – AVData Video Streaming Interface
03h00hAudio/Video Device – AVData Audio Streaming Interface

Base Class 11h (Billboard Device)

This base class is defined for devices that conform to the Billboard Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Device Descriptors.

Base ClassSubClassProtocolMeaning
11h00h00hBillboard Device

Base Class 12h (USB Type-C Bridge Device)

This base class is defined for devices that conform to the USB Type-C Bridge Device Class Specification found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
12h00h00hUSB Type-C Bridge Device

Base Class DCh (Diagnostic Device)

This base class is defined for devices that diagnostic devices. This class code can be used in Device or Interface Descriptors.
Trace is a form of debugging where processor or system activity is made externally visible in real-time or stored and later retrieved for viewing by an applications developer, applications program, or, external equipment specializing observing system activity.
Design for Debug or Test (Dfx). This refers to a logic block that provides debug or test support (E.g. via Test Access Port (TAP)).
DvC: Debug Capability on the USB device (Device Capability)

Base ClassSubClassProtocolMeaning
DCh01h01hUSB2 Compliance Device. Definition for this device can be found at http://www.intel.com/technology/usb/spec.htm
02h00hDebug Target vendor defined. Please see http://www.intel.com/content/www/us/en/io/universal-serial-bus/extensible-host-controler-interface-usb-xhci.html for more info.
01hGNU Remote Debug Command Set. Please see http://www.intel.com/content/www/us/en/io/universal-serial-bus/extensible-host-controler-interface-usb-xhci.html for more info.
03h00hUndefined
01hVendor defined Trace protocol on DbC.
04h00hUndefined
01hVendor defined Dfx protocol on DbC.
05h00hVendor defined Trace protocol over General Purpose (GP) endpoint on DvC.
01hGNU Protocol protocol over General Purpose (GP) endpoint on DvC.http://www.gnu.org/software/gdb/
06h00hUndefined
01hVendor defined Dfx protocol on DvC.
07h00hUndefined
01hVendor defined Trace protocol on DvC.
08h00hUndefined

Base Class E0h (Wireless Controller)

This base class is defined for devices that are Wireless controllers. Values not shown in the table below are reserved. These class codes are to be used in Interface Descriptors, with the exception of the Bluetooth class code which can also be used in a Device Descriptor.

Base ClassSubClassProtocolMeaning
E0h01h01hBluetooth Programming Interface. Get specific information from www.bluetooth.com.
02hUWB Radio Control Interface. Definition for this is found in the Wireless USB Specification in Chapter 8.
03hRemote NDIS. Information can be found at: http://www.microsoft.com/windowsmobile/mobileoperators/default.mspx
04hBluetooth AMP Controller. Get specific information from www.bluetooth.com.
2h01hHost Wire Adapter Control/Data interface. Definition can be found in the Wireless USB Specification in Chapter 8.
02hDevice Wire Adapter Control/Data interface. Definition can be found in the Wireless USB Specification in Chapter 8.
03hDevice Wire Adapter Isochronous interface. Definition can be found in the Wireless USB Specification in Chapter 8.

Base Class EFh (Miscellaneous)

This base class is defined for miscellaneous device definitions. Values not shown in the table below are reserved. The use of these class codes (Device or Interface descriptor) are specifically annotated in each entry below.

Base ClassSubClassProtocolMeaning
EFh01h01hActive Sync device. This class code can be used in either Device or Interface Descriptors. Contact Microsoft for more information on this class.
02hPalm Sync. This class code can be used in either Device or Interface Descriptors.
02h01hInterface Association Descriptor. The usage of this class code triple is defined in the Interface Association Descriptor ECN that is provided on www.usb.org . This class code may only be used in Device Descriptors.
02hWire Adapter Multifunction Peripheral programming interface. Definition can be found in the Wireless USB Specification in Chapter 8. This class code may only be used in Device Descriptors
03h01hCable Based Association Framework. This is defined in the Association Model addendum to the Wireless USB specification. This class code may only be used in Interface Descriptors.
04h01hRNDIS over Ethernet.Connecting a host to the Internet via Ethernet mobile device. The device appears to the host as an Ethernet gateway device.This class code may only be used in Interface Descriptors.
02hRNDIS over WiFi.Connecting a host to the Internet via WiFi enabled mobile device. The device represents itself to the host as an 802.11 compliant network device.This class code may only be used in Interface Descriptors.
03hRNDIS over WiMAXConnecting a host to the Internet via WiMAX enabled mobile device. The device is represented to the host as an 802.16 network device.This class code may only be used in Interface Descriptors.
04hRNDIS over WWANConnecting a host to the Internet via a device using mobile broadband, i.e. WWAN (GSM/CDMA).This class code may only be used in Interface Descriptors.
05hRNDIS for Raw IPv4Connecting a host to the Internet using raw IPv4 via non-Ethernet mobile device. Devices that provide raw IPv4, not in an Ethernet packet, may use this form to in lieu of other stock types.This class code may only be used in Interface Descriptors.
06hRNDIS for Raw IPv6Connecting a host to the Internet using raw IPv6 via non-Ethernet mobile device. Devices that provide raw IPv6, not in an Ethernet packet, may use this form to in lieu of other stock types.This class code may only be used in Interface Descriptors.
07hRNDIS for GPRSConnecting a host to the Internet over GPRS mobile device using the device’s cellular radio
05h Machine Vision Device conforming to the USB3 Vision specification. This standard covers cameras and other related devices that are typically used in machine vision, industrial, and embedded applications.Reference: http://visiononline.org/This class code may only be used in Interface Descriptors.00hUSB3 Vision Control Interface
01hUSB3 Vision Event Interface
02hUSB3 Vision Streaming Interface
06h01hSTEP. Stream Transport Efficient Protocol for content protection.
02hSTEP RAW. Stream Transport Efficient Protocol for Raw content protection.
07h The DVB Common Interface (DVB-CI) specification describes a system whereby a removable CI Conditional Access Module (CICAM), given the appropriate usage rights, unscrambles protected pay-TV content and routes it over the same interface back to a TV receiver for display. An interface association for a DVB-CI function will contain a DVB-CI Command Interface for command, control, and status information, it may contain a DVB-CI Media Interface for audiovisual data streams, and it may also contain a CDC EEM interface to provide bridged networking to the CICAM.Reference: https://www.dvb.org/standards/dvb-ci-plus01hCommand Interface in IAD
01hCommand Interface in Interface Descriptor
02hMedia Interface in Interface Descriptor

Base Class FEh (Application Specific)

This base class is defined for devices that conform to several class specifications found on the USB-IF website. That specification defines the usable set of SubClass and Protocol values. Values outside of that defined spec are reserved. These class codes can only be used in Interface Descriptors.

Base ClassSubClassProtocolMeaning
FEh01h01hDevice Firmware Upgrade. Device class definition provided on www.usb.org .
02h00hIRDA Bridge device. Device class definition provided on www.usb.org .
03h00hUSB Test and Measurement Device. Definition provided in the USB Test and Measurement Class spec found on www.usb.org .
01hUSB Test and Measurement Device conforming to the USBTMC USB488 Subclass Specification found on www.usb.org.

Base Class FFh (Vendor Specific)

This base class is defined for vendors to use as they please. These class codes can be used in both Device and Interface Descriptors.

Base ClassSubClassProtocolMeaning
FFhxxhxxhVendor specific
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值