1、使用在ubuntu下使用usbview得到设备描述符

ME909S-821的设备描述符如下:
HUAWEI Mobile V7R11
Manufacturer: Huawei Technologies Co., Ltd.
Serial Number: 0123456789ABCDEF
Speed: 480Mb/s (high)
USB Version:  2.10
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: ff
Maximum Default Endpoint Size: 64
Number of Configurations: 3
Vendor Id: 12d1
Product Id: 15c1
Revision Number:  1.02Config Number: 1Number of Interfaces: 6Attributes: a0MaxPower Needed:   2mAInterface Number: 0Name: Alternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 10Number of Endpoints: 3Endpoint Address: 82Direction: inAttribute: 3Type: Int.Max Packet Size: 10Interval: 32msEndpoint Address: 81Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 01Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 1Name: Alternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 13Number of Endpoints: 2Endpoint Address: 83Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 02Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 2Name: Alternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 12Number of Endpoints: 2Endpoint Address: 84Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 03Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 3Name: Alternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 16Number of Endpoints: 1Endpoint Address: 86Direction: inAttribute: 3Type: Int.Max Packet Size: 16Interval: 2msInterface Number: 3Name: Alternate Number: 1Class: ff(vend.) Sub Class: 06Protocol: 16Number of Endpoints: 3Endpoint Address: 86Direction: inAttribute: 3Type: Int.Max Packet Size: 16Interval: 2msEndpoint Address: 85Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 04Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 4Name: Alternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 06Number of Endpoints: 2Endpoint Address: 87Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 05Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 5Name: Alternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 1bNumber of Endpoints: 2Endpoint Address: 88Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 06Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msConfig Number: 2Number of Interfaces: 7Attributes: a0MaxPower Needed:   2mAInterface Number: 0Name: cdc_etherAlternate Number: 0Class: 02(comm.) Sub Class: 06Protocol: 00Number of Endpoints: 1Endpoint Address: 82Direction: inAttribute: 3Type: Int.Max Packet Size: 16Interval: 2msInterface Number: 1Name: cdc_etherAlternate Number: 0Class: 0a(data ) Sub Class: 06Protocol: 00Number of Endpoints: 2Endpoint Address: 81Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 01Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 2Name: optionAlternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 10Number of Endpoints: 3Endpoint Address: 84Direction: inAttribute: 3Type: Int.Max Packet Size: 10Interval: 32msEndpoint Address: 83Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 02Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 3Name: optionAlternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 13Number of Endpoints: 2Endpoint Address: 85Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 03Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 4Name: optionAlternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 12Number of Endpoints: 2Endpoint Address: 86Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 04Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 5Name: optionAlternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 06Number of Endpoints: 2Endpoint Address: 87Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 05Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msInterface Number: 6Name: optionAlternate Number: 0Class: ff(vend.) Sub Class: 06Protocol: 1bNumber of Endpoints: 2Endpoint Address: 88Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 06Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msConfig Number: 3Number of Interfaces: 2Attributes: a0MaxPower Needed:   2mAInterface Number: 0Name: Alternate Number: 0Class: 02(comm.) Sub Class: 0eProtocol: 00Number of Endpoints: 1Endpoint Address: 82Direction: inAttribute: 3Type: Int.Max Packet Size: 16Interval: 2msInterface Number: 1Name: Alternate Number: 0Class: 0a(data ) Sub Class: 00Protocol: 02Number of Endpoints: 0Interface Number: 1Name: Alternate Number: 1Class: 0a(data ) Sub Class: 00Protocol: 02Number of Endpoints: 2Endpoint Address: 81Direction: inAttribute: 2Type: BulkMax Packet Size: 512Interval: 0msEndpoint Address: 01Direction: outAttribute: 2Type: BulkMax Packet Size: 512Interval: 0ms
是不是特别多、特别长,但是以上设备描述符中,接口描述符不一定都有用。

简单描述一下设备描述符的组成,还是用图片加描述的方式:

在USB协议里,一个设备描述符代表一个USB设备,一个设备描述符有多个配置描述符,一般情况下,只有一个配置描述符其作用,同时,这个每个配置描述符也有多个接口描述符,这些接口描述符里边也存在不起作用的接口描述符。在这个4G模块里边,没有其他设备类描述符,什么叫设备类描述符,这里有点内容过了,与4G模块无关。

2、分析设备描述符方法

       从设备描述符入手,在USB协议上找到相应的定义。下面是ME909S的设备描述符,其中将没有用的配置描述符去掉了,只剩下配置描述符2。
HUAWEI Mobile V7R11---------------------------------设备名字
Manufacturer: Huawei Technologies Co., Ltd.-----制造商
Serial Number: 0123456789ABCDEF---------------序列号,写驱动反正没用上
Speed: 480Mb/s (high)---------------------------------这是一个高速的USB设备
USB Version:  2.10--------------------------------------使用的USB2.0协议,当然高速设备就是USB2.0的接口
Device Class: 00(>ifc )---------------------------------1、设备类,有用
Device Subclass: 00------------------------------------2、设备子类,有用
Device Protocol: ff---------------------------------------3、设备协议,只要是FF,就代表厂商自己定义的
Maximum Default Endpoint Size: 64
Number of Configurations: 3--------------------------包含配置描述符个数
Vendor Id: 12d1-----------------------------------------4、厂商ID号
Product Id: 15c1----------------------------------------4、产品ID号
Revision Number:  1.02-------------------------------

Config Number: 2--------------------------------------配置描述符2,通过分析只有这个里边的接口描述符才有详细名字
Number of Interfaces: 7------------------------接口描述符个数
Attributes: a0-------------------------------------5、属性
MaxPower Needed:   2mA

Interface Number: 0
Name: cdc_ether
Alternate Number: 0
Class: 02(comm.) -------------------------6、接口的类
Sub Class: 06-------------------------------7、接口子类
Protocol: 00---------------------------------8、使用的协议
Number of Endpoints: 1

Endpoint Address: 82
Direction: in
Attribute: 3
Type: Int.
Max Packet Size: 16
Interval: 2ms

Interface Number: 1
Name: cdc_ether
Alternate Number: 0
Class: 0a(data ) 
Sub Class: 06
Protocol: 00
Number of Endpoints: 2

Endpoint Address: 81
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Endpoint Address: 01
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Interface Number: 2
Name: option
Alternate Number: 0
Class: ff(vend.) 
Sub Class: 06
Protocol: 10
Number of Endpoints: 3

Endpoint Address: 84
Direction: in
Attribute: 3
Type: Int.
Max Packet Size: 10
Interval: 32ms

Endpoint Address: 83
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Endpoint Address: 02
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Interface Number: 3
Name: option
Alternate Number: 0
Class: ff(vend.) 
Sub Class: 06
Protocol: 13
Number of Endpoints: 2

Endpoint Address: 85
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Endpoint Address: 03
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Interface Number: 4
Name: option
Alternate Number: 0
Class: ff(vend.) 
Sub Class: 06
Protocol: 12
Number of Endpoints: 2

Endpoint Address: 86
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Endpoint Address: 04
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Interface Number: 5
Name: option
Alternate Number: 0
Class: ff(vend.) 
Sub Class: 06
Protocol: 06
Number of Endpoints: 2

Endpoint Address: 87
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Endpoint Address: 05
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Interface Number: 6
Name: option
Alternate Number: 0
Class: ff(vend.) 
Sub Class: 06
Protocol: 1b
Number of Endpoints: 2

Endpoint Address: 88
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

Endpoint Address: 06
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 512
Interval: 0ms

        在这里,先对第4点说明,厂商ID和设备ID是绑定一个USB驱动首要标准。
        重点说明class、subclass和protocol(参考USB开发者网站:点击打开链接):在USB开发者网站有一张表:
       在这个4G模块里边,首先是设备描述符开头,其class、subclass为00,从上表说明可以看出,这个4G模块的功能是在USB接口描述符里边说明或者表现出来的。

接下来是配置描述符2里边接口描述符0的class、subclass和protocol,这里只分析接口描述符0,对其他起作用的接口描述符不分析,分析方法是一致的。如下面:

Class: 02(comm.) -------------------------6、接口的类
Sub Class: 06-------------------------------7、接口子类
Protocol: 00---------------------------------8、使用的协议
从上面的表里,可以找到class为02的含义:代表这个USB设备为一个通信设备2017/06/18晚
Sub Class = 06 代表这个是Ethernet Control Model(以太网控制模型),
Protocol = 00 代表不需要类特定协议
接下来,就是在什么地方找到这些答案的-----------------------------------?????????????
1--Class的定义 答案:Defined 1.0 Class Codes
2--Sub Class定义 答案:USB Device Class Specifications
        上面这两个USB协议网站有些不同,第一个主要就是上边的表格,下面的网站比较详细,对USB协议中五种设备的详细说明。
3--Protocol定义 答案:USB Device Class Specifications,里面包括每一种设备的详细说明。

3、详细分析4G模块的Class、Sub Class、Protocol与接口驱动程序之间的关系

来吧,看一张图,只是说明很小部分的关系,不可强证:
     对于4G模块,采用了第三种寻找驱动的方法,由于4G模块采用的USB驱动绑定套路是:先根据常规的USB驱动绑定套路,绑定一个常规USB驱动,执行USB驱动里边probe探测函数,在探测函数里会根据前面枚举得到的设备描述符里的接口描述符(当然了,是有用的接口描述符,如何才算有用:接口有名字或者根据class和subclass分析,知道这个接口对于实现某一功能有用),4G模块
为5个接口描述符绑定了同一个usbserial接口驱动程序(usbtty0---usbtty4),具体有些接口没有研究透,实现打电话、发短信只是有到了usbtty0。

第三篇 ME909s-821设备描述符分析相关推荐

  1. PHP 性能分析第三篇: 性能调优实战

    注意:本文是我们的 PHP 性能分析系列的第三篇,点此阅读 PHP 性能分析第一篇: XHProf & XHGui 介绍 ,或  PHP 性能分析第二篇: 深入研究 XHGui. 在本系列的 ...

  2. hadoop作业初始化过程详解(源码分析第三篇)

    (一)概述 我们在上一篇blog已经详细的分析了一个作业从用户输入提交命令到到达JobTracker之前的各个过程.在作业到达JobTracker之后初始化之前,JobTracker会通过submit ...

  3. 分析RAC下一个SPFILE整合的三篇文章的文件更改

    大约RAC下一个spfile分析_整理在_2014.4.17 说明:文章来源于网络 第一篇:RAC下SPFILE文件改动 在RAC下spfile位置的改动与单节点环境不全然一致,有些地方须要特别注意, ...

  4. 小学计算机学情分析,小学信息技术教学计划【三篇】

    [导语]本篇是无忧考网为您整理的小学信息技术教学计划[三篇],仅供大家参考. [第1篇] 一.教材分析 <小学信息技术(四年级上)>教材的主要内容是Word文本处理及编辑排版,也结合了电子 ...

  5. 教学质量分析系统 php,教学质量分析报告【三篇】

    [导语]分析报告的标题一般有两种形式:一是公文式,另一种是新闻报道式.以下是无忧考网整理的教学质量分析报告,欢迎阅读! 篇一 今天,我们在这里召开全校2010--2011学年第二学期教学质量分析会,主 ...

  6. android之view重绘,跟着郭大侠一步步深入了解View第三篇之Android视图状态及重绘流程分析...

    作为对View进行学习的第三篇文章,本文将讲解一下视图状态以及重绘方面的知识. 相信大家在平时使用View的时候都会发现它是有状态的,比如说有一个按钮,普通状态下是一种效果,但是当手指按下的时候就会变 ...

  7. 电子计算机和多媒体教材分析,【精选】教学设计方案模板锦集三篇

    [精选]教学设计方案模板锦集三篇 为了确保工作或事情能高效地开展,常常需要提前进行细致的方案准备工作,方案可以对一个行动明确一个大概的方向.我们应该怎么制定方案呢?以下是小编为大家整理的教学设计方案5 ...

  8. photoshop-v.1.0.1源码分析第三篇–FilterInterface.p

    photoshop-v.1.0.1源码分析第三篇–FilterInterface.p 总体预览 一.源码预览 二.语法解释 三.结构预览 四:语句分析 五:思维导图 六:疑留问题 一.源码预览 {Ph ...

  9. PopStar(消灭星星)游戏源代码下载、分析及跨平台移植---第三篇(分数)

    背景: 经过消灭星星第二篇算法,最高的山峰已经过去了,剩下的都是小沟小河,没什么难度了.这一节笔者继续完成消灭星星的分数篇,这节主要包括:触摸提示得分 比如4 blocks 80 points,然后产 ...

  10. 职高学生计算机学情分析,精选中职计算机说课稿三篇

    精选中职计算机说课稿三篇 中职计算机说课稿(一) 位评委老师,你们好!我是来自XXX职业中专计算机专业的教师XXX,今天我说课的题目是<电子表格基本操作>.本节课出自高等教育出版社出版的& ...

最新文章

  1. 微信怎么at所有人_任正非被遗漏的讲话:怎么做一个谦虚的领导者?
  2. Echarts读取本地json文件渲染轨迹,亲测ok
  3. 判断一个string是否可以为数字
  4. 缓存穿透、缓存并发、热点缓存之最佳招式
  5. hadoop大数据平台架构之DKhadoop详解
  6. Freemarker中如何遍历List
  7. python cms tornado_都2020年了,python的tornado框架还有用武之力么?
  8. SVG 教程 (二)矩形
  9. Flink 小贴士 (7): 4个步骤,让 Flink 应用达到生产状态
  10. angular—— Dynamic Templates
  11. 竖屏小游戏--喵星战争源代码分析【完整】
  12. 使用代理IP软件需要了解的三个概念
  13. 数据结构期末考题总结(附答案)
  14. python实现QQ自动发送信息
  15. 富途客户端软件测试笔试and面试
  16. 云端服务器跑python代码,断开后台运行
  17. 二层交换机的工作原理
  18. 人力资源管理的毕业论文选题推荐?
  19. 9、攻守兼备的投资利器--可转债基金
  20. SpringCloud搭建NetFilx-Eureka(小白专属)

热门文章

  1. 消消乐游戏算法实现(三消乐)
  2. 三消类游戏的核心算法
  3. 云片网发送短信验证码
  4. 2021年田野的风响彻了整个冰岛
  5. 小葵花妈妈课堂开课了:《AsyncTask源码分析》
  6. linux 飞信机器人 下载,飞信机器人FXRobot 's | CN-SEC 中文网
  7. 爬虫实战(自用)requests模块、聚焦爬虫(数据解析)、selenium模块
  8. 电脑上传,如何查看电脑上传速度
  9. 什么是搜索引擎???搜索引擎的介绍
  10. 今天是冰桶算法大揭秘!!