【USB描述符系列】二维码扫描枪

简介

使用了一款USB接口的二维码扫描枪,看了下这个设备的描述符也没有什么特别的。从描述符可以看到,这个设备就是枚举成一个HID KeyBoard,和普通的键盘没有什么区别。二维码扫描枪在扫描获取到信息后,作为HID键盘设备上报了键值。用的这个USB设备是一个Full Speed设备。

下面是这个USB接口的二维码扫描枪的描述符,产品的VID和PID被我隐去了。

Device Descriptor

Offset Field Size Value Description
0 bLength 1 12h Size of this descriptor
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0110h USB Spec 1.1
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h Unused
6 bDeviceProtocol 1 00h Unused
7 bMaxPacketSize0 1 40h 64 bytes
8 idVendor 2 XXXXh Vendor ID
10 idProduct 2 XXXXh Product ID
12 bcdDevice 2 0001h 0.01
14 iManufacturer 1 00h Unused
15 iProduct 1 00h Unused
16 iSerialNumber 1 00h Unused
17 bNumConfigurations 1 01h One configuration

Configuration Descriptor

Offset Field Size Value Description
0 bLength 1 09h Size of this descriptor
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 0022h Length of the total configuration block, including this descriptor, in bytes
4 bNumInterfaces 1 01h One interfaces
5 bConfigurationValue 1 01h ID of this configuration
6 iConfiguration 1 00h Unused
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
4…0: Reserved . . . 00000 Unused
5: Remote Wakeup . .1 . . . . . Yes
6: Self Powered . 0 . . . . . . No, Bus Powered
7: Reserved (set to one)
(bus-powered for 1.0)
1 . . . . . . . Unused
8 bMaxPower 1 65h 202 mA

Interface Descriptor 0/0 HID, 1 Endpoints

Offset Field Size Value Description
0 bLength 1 09h Size of this descriptor
1 bDescriptorType 1 04h INTERFACE
2 bInterfaceNumber 1 00h Index of this interface
3 bAlternateSetting 1 00h Index of this setting
4 bNumEndpoints 1 01h 1 endpoints
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 00h Unused

HID Descriptor

Offset Field Size Value Description
0 bLength 1 09h Size of this descriptor
1 bDescriptorType 1 21h HID
2 bcdHID 2 0110h 1.10
4 bCountryCode 1 00h
5 bNumDescriptors 1 01h
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 006Ah 106 bytes

Endpoint Descriptor 81 1 In, Interrupt, 1 ms

Offset Field Size Value Description
0 bLength 1 07h Size of this descriptor
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
1…0: Transfer Type . . . . . .11 Interrupt
7…2: Reserved 000000 . . Unused
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

Interface 0 HID Report Descriptor Keyboard

Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01
Usage (Keyboard) 09 06
Collection (Application) A1 01
 Usage Page (Keyboard/Keypad) 05 07
 Report ID (3) 85 03
 Usage Minimum (Keyboard Left Control) 19 E0
 Usage Maximum (Keyboard Right GUI) 29 E7
 Logical Minimum (0) 15 00
 Logical Maximum (1) 25 01
 Report Size (1) 75 01
 Report Count (8) 95 08
Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
 Report Count (1) 95 01
 Report Size (8) 75 08
Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 03
 Report Count (1) 95 01
 Report Size (8) 75 08
 Logical Minimum (0) 15 00
 Logical Maximum (-25) 25 E7
 Usage Page (Keyboard/Keypad) 05 07
 Usage Minimum (Undefined) 19 00
 Usage Maximum (Keyboard LANG1) 29 90
Input(Data,Ary,Abs) 81 00
 Report ID (3) 85 03
 Report Count (5) 95 05
 Report Size (1) 75 01
 Usage Page (LEDs) 05 08
 Usage Minimum (Num Lock) 19 01
 Usage Maximum (Kana) 29 05
Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02
 Report Count (1) 95 01
 Report Size (3) 75 03
Output (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 03
End Collection C0
Usage Page (Generic Desktop) 05 01
Usage (Undefined) 09 10
Collection (Application) A1 01
 Usage Page (Keyboard/Keypad) 05 07
 Report ID (186) 85 BA
 Usage Minimum (Keyboard Left Control) 19 E0
 Usage Maximum (Keyboard Right GUI) 29 E7
 Logical Minimum (0) 15 00
 Logical Maximum (-1) 25 FF
 Report Size (63) 75 3F
 Report Count (8) 95 08
 Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
 Report ID (186) 85 BA
 Report Count (8) 95 08
 Report Size (63) 75 3F
 Usage Page (LEDs) 05 08
 Usage Minimum (Num Lock) 19 01
 Usage Maximum (Kana) 29 05
 Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02
End Collection C0

本文链接:https://blog.csdn.net/u012028275/article/details/115569000

【USB描述符系列】二维码扫描枪相关推荐

  1. 二维码扫描自定义规则思路

    二维码扫描自定义规则思路 二维码内容 二维码内容是一串字符串,主要凭借拆分字符串实现宿主属性的读取.可用于商品产品原材料入库.出库等操作. 使用在线的二维码生成之后,就是这样,其中可以使用特殊符号进行 ...

  2. android USB摄像头做条形码及二维码扫描(1)

    摘要: 1.前言 2.底层配置 3.JNI实现 4.总结 5.BUG及优化记录 android USB摄像头做条形码及二维码扫描(2) 1. 前言 公司做的产品基于android开发板搭建的控制系统, ...

  3. GM65条形码二维码扫描识别模块与STM32学习

    目录 模块介绍: 简介: 原理介绍: 工作流程: 技术参数: 修改配置: 代码介绍: 串口函数: 主函数: 模块介绍: 简介: GM65 条形码二维码扫描识别模块是一种基于激光扫描头的识别设备 原理介 ...

  4. js 二维码扫描盒/枪对接

    二维码扫描盒/枪对接 前言 二维码应用非常广泛,使用场景有:手机上网.个人名片.凭证类.溯源类.数据防伪等等,如下图: 使用也非常简单,外接USB接口, 如下图,以下就是我对接的盒子 原理 ​ 拿到二 ...

  5. 二维码扫描开源库ZXing定制化【转】

    转自:http://www.cnblogs.com/sickworm/p/4562081.html 最近在用ZXing这个开源库做二维码的扫描模块,开发过程的一些代码修改和裁剪的经验和大家分享一下. ...

  6. Android 二维码扫描(仿微信界面),根据Google zxing

    Android 二维码扫描(仿微信界面),根据Google zxing Android项目开发中经常会用到二维码扫描,例如登陆.支付等谷歌方面已经有了一个开源库(地址: https://github. ...

  7. 基于Capacitor编写Ionic React二维码扫描应用

    在上一篇文章中,我们简要演示了如何使用capacitor-plugin-dynamsoft-barcode-reader构建跨平台二维码扫描应用.在本文中,我们将使用Ionic React来构建一个二 ...

  8. 二维码扫描讲解系统设计方法

    二维码扫描讲解系统设计方法 测试软件平台进入: http://www.cqu-media.top http://www.cqu-media.com/qrcode.aspx http://www.cqu ...

  9. 二维码扫描开源库ZXing定制化

    最近在用ZXing这个开源库做二维码的扫描模块,开发过程的一些代码修改和裁剪的经验和大家分享一下. 建议: 如果需要集成到自己的app上,而不是做一个demo,不推荐用ZXing的Android外围开 ...

  10. EM20在地铁闸机的二维码扫描的应用案例

    随着移动支付的发展,人们的出现变得更加便捷,通过使用EM20二维码扫描模组嵌入到地铁的通道闸机中,可以实现移动扫码进站,实现流程化的乘车体验. 今天,我们从EM20新大陆扫描模组的应用案例讲起,据统计 ...

最新文章

  1. python工作好找吗-Python好找工作吗 不看会后悔
  2. MATLAB实战系列(十二)-如何用人工鱼群算法解决带时间窗车辆路径(CVRP)问题(附MATLAB代码)
  3. oracle数据库恢复参数文件位置,Oracle数据库的参数文件备份与恢复
  4. qt 进程打开excel_Python干货:多进程与多线程!
  5. caffe 使用cudnn 加速报错
  6. 基于CNN的中文文本分类算法(可应用于垃圾文本过滤、情感分析等场景)
  7. seaborn箱线图_Seaborn线图的数据可视化
  8. 内存越界访问保护 内存泄漏研究 未完待续
  9. eja智能压力变送器工作原理_eja变送器详解_eja变送器工作原理_eja变送器如何选型...
  10. 【Web文件上传下载】各种类型文件对应的content-type
  11. REST Assured 55 - JSON Schema Validation In Rest Assured
  12. 计算机组成原理——系统总线
  13. OSPF认证、虚链路、过滤、track
  14. LMIC一直busy解决方法
  15. html文件做屏保win10,win10系统把屏保设置为桌面壁纸的处理方法
  16. 服装标准中纰裂试验方法的比较与探讨
  17. 掌握销售谈判三大策略,开单成功率提升60%!
  18. 双通道14位、500 MSPS采样率的AD9684 高速并行LVDS ADC接口介绍
  19. RK3588平台开发系列讲解(文件系统篇)Linux 文件系统简介
  20. vue+腾讯地图标记弹框

热门文章

  1. react Hook useContext()
  2. 天气预报接口_JMeter 接口自动化测试篇 26
  3. Numpy图解(三)--高维数组
  4. GEE开发之Sentinel-2计算NDVI和数据分析
  5. BFF —— Backend For Frontend
  6. 面试官说:Spring这几个问题你回答下,月薪3万,下周来上班!
  7. C++实现string的spilt功能-temp
  8. spilt的用法小结
  9. 关于 Burrows-Wheeler 变换和 Lempel-Ziv 解析的一些认识
  10. STM32(RFID)阶段三(触屏数字键盘)