Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9138471
  • 博文数量: 1725
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19840
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1725)

文章存档

2024年(1)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: Android平台

2016-04-22 19:42:01

http://blog.csdn.net/gaojinshan/article/details/7878330

USB(Universal Serial BUS,通用串行总线)协议规定,所有的USB设备都有VID(Vendor ID,供应商识别码)和PID(Product ID,产品识别码)。VID由供应商向USB-IF(Implementers Forum,应用者论坛)申请。每个供应商的VID是唯一的,PID由供应商自行决定。主机通过VID和PID来识别不同设备,根据它们(以及设备的版本号),可以给设备加载或安装相应的驱动程序。VID和PID的长度都是两个字节的。
常见的各大供应商的VID和PID,可以在这里查询到:

USB定义了种类代码信息,它被用来识别设备的功能,根据这些功能,以加载设备驱动。这种信息包含在名为基类,子类和协议的3个字节里(注意:“基类”在本文中,用来标识三个字节的种类代码的的首字节;在USB规范中没有使用这个术语)。设备中有两个地方可以存放种类代码信息,一个是设备描述符,另一个是接口描述符。已经定义的种类代码,有些只能用在设备描述符里,有些只能用在接口描述符里,有些两种描述符里都可用。下表给出现在已经定了的基类的值的集合,通常用法是什么,基类用在什么场合(设备描述符或接口描述符)。
其具体定义参见USB官方网址:http://www.usb.org/developers/defined_class
各种类的定义参见:http://www.usb.org/developers/devclass_docs

Base Class

Descriptor Usage

Description

00h

Device

Use class information in the Interface Descriptors 种类信息定义在接口描述符中

01h

Interface

Audio 音频设备

02h

Both

Communications & CDC 通信设备(手机,Class_02&SubClass_02&Prot_01

03h

Interface

HID (Human Interface Device) 人机接口设备

05h

Interface

Physical 物理设备

06h

Interface

Image 图像设备(可能是IPhone手机,Class_06&SubClass_01&Prot_01

07h

Interface

Printer 打印机

08h

Interface

Mass Storage 大容量存储(可能是,Class_08&SubClass_06&Prot_50

09h

Device

Hub 集线器

0Ah

Interface

CDC-Data 通信设备(手机,Class_0A&SubClass_00&Prot_00

0Bh

Interface

Smart Card 智能卡

0Dh

Interface

Content Security 内容安全设备

0Eh

Interface

Video 视频设备(摄像头,Class_0e&SubClass_03&Prot_00)

0Fh

Interface

Personal Healthcare 个人健康设备

10h

Interface

Audio/Video Devices 音频/视频设备

DCh

Both

Diagnostic Device 诊断设备(USB2兼容设备)

E0h

Interface

Wireless Controller 无线控制器(蓝牙设备等)

EFh

Both

Miscellaneous 杂项(ActiveSync,PalmSync,各种协会等)

FEh

Interface

Application Specific 应用专有规范(固件升级,红外,USB测试与测量等)

FFh

Both

Vendor Specific 供应商自定义规范(手机,Class_FF&SubClass_FF&Prot_FF



参考了
https://developer.mbed.org/users/k4zuki/notebook/usb-cdcmsd-compositeDevice/

点击(此处)折叠或打开

  1. Bus 001 Device 050: ID 1f00:2012
  2. Device Descriptor:
  3.   bLength 18
  4.   bDescriptorType 1
  5.   bcdUSB 1.10
  6.   bDeviceClass 239 Miscellaneous Device
  7.   bDeviceSubClass 2 ?
  8.   bDeviceProtocol 1 Interface Association
  9.   bMaxPacketSize0 64
  10.   idVendor 0x1f00
  11.   idProduct 0x2012
  12.   bcdDevice 1.00
  13.   iManufacturer 1 mbed.org
  14.   iProduct 2 CDCMSC DEVICE
  15.   iSerial 3 0123456789
  16.   bNumConfigurations 1
  17.   Configuration Descriptor:
  18.     bLength 9
  19.     bDescriptorType 2
  20.     wTotalLength 98
  21.     bNumInterfaces 3
  22.     bConfigurationValue 1
  23.     iConfiguration 0
  24.     bmAttributes 0xc0
  25.       Self Powered
  26.     MaxPower 100mA
  27.     Interface Association:
  28.       bLength 8
  29.       bDescriptorType 11
  30.       bFirstInterface 0
  31.       bInterfaceCount 2
  32.       bFunctionClass 2 Communications
  33.       bFunctionSubClass 2 Abstract (modem)
  34.       bFunctionProtocol 1 AT-commands (v.25ter)
  35.       iFunction 0
  36.     Interface Descriptor:
  37.       bLength 9
  38.       bDescriptorType 4
  39.       bInterfaceNumber 0
  40.       bAlternateSetting 0
  41.       bNumEndpoints 1
  42.       bInterfaceClass 2 Communications
  43.       bInterfaceSubClass 2 Abstract (modem)
  44.       bInterfaceProtocol 1 AT-commands (v.25ter)
  45.       iInterface 0
  46.       CDC Header:
  47.         bcdCDC 1.10
  48.       CDC Call Management:
  49.         bmCapabilities 0x03
  50.           call management
  51.           use DataInterface
  52.         bDataInterface 1
  53.       CDC ACM:
  54.         bmCapabilities 0x06
  55.           sends break
  56.           line coding and serial state
  57.       CDC Union:
  58.         bMasterInterface 0
  59.         bSlaveInterface 1
  60.       Endpoint Descriptor:
  61.         bLength 7
  62.         bDescriptorType 5
  63.         bEndpointAddress 0x81 EP 1 IN
  64.         bmAttributes 3
  65.           Transfer Type Interrupt
  66.           Synch Type None
  67.           Usage Type Data
  68.         wMaxPacketSize 0x0040 1x 64 bytes
  69.         bInterval 16
  70.     Interface Descriptor:
  71.       bLength 9
  72.       bDescriptorType 4
  73.       bInterfaceNumber 1
  74.       bAlternateSetting 0
  75.       bNumEndpoints 2
  76.       bInterfaceClass 10 CDC Data
  77.       bInterfaceSubClass 0 Unused
  78.       bInterfaceProtocol 0
  79.       iInterface 0
  80.       Endpoint Descriptor:
  81.         bLength 7
  82.         bDescriptorType 5
  83.         bEndpointAddress 0x82 EP 2 IN
  84.         bmAttributes 2
  85.           Transfer Type Bulk
  86.           Synch Type None
  87.           Usage Type Data
  88.         wMaxPacketSize 0x0040 1x 64 bytes
  89.         bInterval 0
  90.       Endpoint Descriptor:
  91.         bLength 7
  92.         bDescriptorType 5
  93.         bEndpointAddress 0x02 EP 2 OUT
  94.         bmAttributes 2
  95.           Transfer Type Bulk
  96.           Synch Type None
  97.           Usage Type Data
  98.         wMaxPacketSize 0x0040 1x 64 bytes
  99.         bInterval 0
  100.     Interface Descriptor:
  101.       bLength 9
  102.       bDescriptorType 4
  103.       bInterfaceNumber 2
  104.       bAlternateSetting 0
  105.       bNumEndpoints 2
  106.       bInterfaceClass 8 Mass Storage
  107.       bInterfaceSubClass 6 SCSI
  108.       bInterfaceProtocol 80 Bulk-Only
  109.       iInterface 4 01
  110.       Endpoint Descriptor:
  111.         bLength 7
  112.         bDescriptorType 5
  113.         bEndpointAddress 0x83 EP 3 IN
  114.         bmAttributes 2
  115.           Transfer Type Bulk
  116.           Synch Type None
  117.           Usage Type Data
  118.         wMaxPacketSize 0x0040 1x 64 bytes
  119.         bInterval 0
  120.       Endpoint Descriptor:
  121.         bLength 7
  122.         bDescriptorType 5
  123.         bEndpointAddress 0x03 EP 3 OUT
  124.         bmAttributes 2
  125.           Transfer Type Bulk
  126.           Synch Type None
  127.           Usage Type Data
  128.         wMaxPacketSize 0x0040 1x 64 bytes
  129.         bInterval 0
  130. Device Status: 0x0001
  131.   Self Powered

阅读(2904) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~