当前位置: 首页 > news >正文

潍坊大宇网络网站建设百度公司

潍坊大宇网络网站建设,百度公司,购物网站设计图,织梦怎么做中英文双语网站字符串描述符 字符串描述符内容解析和 HID鼠标 一致。 获取字符串描述符请求 标准设备请求 typedef struct __attribute__ ((packed)){union {struct __attribute__ ((packed)) {uint8_t recipient : 5; ///< Recipient type usb_request_recipient_t.uint8_t type …

字符串描述符

字符串描述符内容解析和 HID鼠标 一致。

获取字符串描述符请求

标准设备请求

typedef struct __attribute__ ((packed)){union {struct __attribute__ ((packed)) {uint8_t recipient :  5; ///< Recipient type usb_request_recipient_t.uint8_t type      :  2; ///< Request type usb_request_type_t.uint8_t direction :  1; ///< Direction type. usb_dir_t} bmRequestType_bit;uint8_t bmRequestType;};uint8_t  bRequest;uint16_t wValue;uint16_t wIndex;uint16_t wLength;
} usb_control_request_t;

语言 ID 获取(字符串索引为 0)

USB 控制端点收到的数据

0x80 0x6 0x0 0x3 0x0 0x0 0xff 0x0
  • bmRequestType:0x80
    • 数据传输方向为 1,device-to-host
    • 标准请求
    • 请求的接收者为设备。
  • bRequest:0x06
    • GET_DESCRIPTOR 获取描述符请求。
  • wValue:0x0003(LSB)
    • 低位:0x03 字符串描述符
    • 高位:0x00 索引号,当前字符串索引为 0,表示获取语言 ID。
  • wIndex:0x0000(LSB)
    • 低位:0x00
    • 高位:0x00
  • wLength:0xff
    • 低位:0xff 请求返回的字节数为 0xff,设备实际返回的字节数可以比该域指定的字节数少。
    • 高位:0x00

语言 ID 返回

0x4 0x3 0x9 0x4 
  • bLength:0x04
    • 描述符的长度。语言 ID 描述符的长度为 0x04。
  • bDescriptorType:0x03
    • 描述符的类型。字符串描述符的类型编码为 0x03。
  • 语言 ID:0x0409
  • 0x0409为美式英语的 ID。

厂商字符串获取(字符串索引为 1)

在 设备描述符,将 iManufacturer,的索引设置为 1。所以主机请求索引为 1 的字符串时,需要返回厂商字符串

USB 控制端点收到的数据

0x80 0x6 0x1 0x3 0x9 0x4 0xff 0x0
  • bmRequestType:0x80
    • 数据传输方向为 1,device-to-host
    • 标准请求
    • 请求的接收者为设备
  • bRequest:0x06
    • GET_DESCRIPTOR 获取描述符请求
  • wValue:0x0003(LSB)
    • 低位:0x03 字符串描述符
    • 高位:0x001 索引号,当前字符串索引为 1,表示获取厂商字符串。
  • wIndex:0x0000(LSB)
    • 低位:0x09 主机使用获取到的语言 ID 0x0409。
    • 高位:0x04
  • wLength:0xff
    • 低位:0xff 请求返回的字节数为 0xff,设备实际返回的字节数可以比该域指定的字节数少。
    • 高位:0x00

厂商字符串返回

0x10 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0
  • bLength:0x10
    • 描述符的长度。本次使用的厂商字符串描述符的长度为 0x10。
  • bDescriptorType:0x03
    • 描述符的类型。字符串描述符的类型编码为 0x03。
  • 厂商字符串:
  • 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 UNICODE 编码的字符串,即为 tyustli

产品字符串获取(字符串索引为 2)

在 设备描述符,将 iProduct,的索引设置为 2。

USB 控制端点收到的数据

0x80 0x6 0x2 0x3 0x9 0x4 0xff 0x0
  • bmRequestType:0x80
    • 数据传输方向为 1,device-to-host
    • 标准请求
    • 请求的接收者为设备
  • bRequest:0x06
    • GET_DESCRIPTOR 获取描述符请求
  • wValue:0x0003(LSB)
    • 低位:0x03 字符串描述符
    • 高位:0x002 索引号,当前字符串索引为 2,表示获取产品字符串。
  • wIndex:0x0000(LSB)
    • 低位:0x09 主机使用获取到的语言 ID 0x0409。
    • 高位:0x04
  • wLength:0xff
    • 低位:0xff 请求返回的字节数为 0xff,设备实际返回的字节数可以比该域指定的字节数少。
    • 高位:0x00

产品字符串返回

0x1e 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 0x20 0x0 0x44 0x0 0x65 0x0 0x76 0x0 0x69 0x0 0x63 0x0 0x65 0x0 
  • bLength:0x1e
    • 描述符的长度。本次使用的产品字符串描述符的长度为 0x1e。
  • bDescriptorType:0x03
    • 描述符的类型。字符串描述符的类型编码为 0x03。
  • 厂商字符串:
  • 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 0x20 0x0 0x44 0x0 0x65 0x0 0x76 0x0 0x69 0x0 0x63 0x0 0x65 0x0 UNICODE 编码的字符串,即为 tyustli Device

产品序列号字符串获取(字符串索引为 3)

在 设备描述符,将 iSerialNumber,的索引设置为 3。

USB 控制端点收到的数据

0x80 0x6 0x3 0x3 0x9 0x4 0xff 0x0
  • bmRequestType:0x80
    • 数据传输方向为 1,device-to-host
    • 标准请求
    • 请求的接收者为设备
  • bRequest:0x06
    • GET_DESCRIPTOR 获取描述符请求
  • wValue:0x0003(LSB)
    • 低位:0x03 字符串描述符
    • 高位:0x003 索引号,当前字符串索引为 3,表示获取产品序列号字符串。
  • wIndex:0x0000(LSB)
    • 低位:0x09 主机使用获取到的语言 ID 0x0409。
    • 高位:0x04
  • wLength:0xff
    • 低位:0xff 请求返回的字节数为 0xff,设备实际返回的字节数可以比该域指定的字节数少。
    • 高位:0x00

产品序列号字符串返回

0xe 0x3 0x31 0x0 0x32 0x0 0x33 0x0 0x34 0x0 0x35 0x0 0x36 0x0 
  • bLength:0x0e
    • 描述符的长度。本次使用的产品字符串描述符的长度为 0x0e。
  • bDescriptorType:0x03
    • 描述符的类型。字符串描述符的类型编码为 0x03。
  • 产品序列号字符串:
  • 0x31 0x0 0x32 0x0 0x33 0x0 0x34 0x0 0x35 0x0 0x36 0x0 UNICODE 编码的字符串,即为 123456

附 STM32 枚举日志

HID 键盘枚举日志

suspend int
bus reset int
enum done int
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x1 0x0 0x0 0x40 0x0 
dcd xfer 12
input ep int 
d->h :0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xfe 0xca 0x8 0x40 0x0 0x1 0x1 0x2 0x3 0x1 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
bus reset int
output ep int 
send xfer complete event
enum done int
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x0 0x5 0x4 0x0 0x0 0x0 0x0 0x0 
dcd xfer 0
input ep int 
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x1 0x0 0x0 0x12 0x0 
dcd xfer 12
input ep int 
d->h :0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xfe 0xca 0x8 0x40 0x0 0x1 0x1 0x2 0x3 0x1 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
output ep int 
send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x2 0x0 0x0 0xff 0x0 
dcd xfer 22
input ep int 
d->h :0x9 0x2 0x22 0x0 0x1 0x1 0x0 0xa0 0x32 0x9 0x4 0x0 0x0 0x1 0x3 0x1 0x1 0x0 0x9 0x21 0x11 0x1 0x0 0x1 0x22 0x41 0x0 0x7 0x5 0x81 0x3 0x8 0x0 0xa 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x3 0x3 0x9 0x4 0xff 0x0 
send xfer complete event
dcd xfer e
input ep int 
d->h :0xe 0x3 0x31 0x0 0x32 0x0 0x33 0x0 0x34 0x0 0x35 0x0 0x36 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x3 0x0 0x0 0xff 0x0 
send xfer complete event
dcd xfer 4
input ep int 
d->h :0x4 0x3 0x9 0x4 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x2 0x3 0x9 0x4 0xff 0x0 
send xfer complete event
dcd xfer 1e
input ep int 
d->h :0x1e 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 0x20 0x0 0x44 0x0 0x65 0x0 0x76 0x0 0x69 0x0 0x63 0x0 0x65 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x6 0x0 0x0 0xa 0x0 
send xfer complete event
get device qualifier
stall ep0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x1 0x0 0x0 0x12 0x0 
dcd xfer 12
input ep int 
d->h :0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xfe 0xca 0x8 0x40 0x0 0x1 0x1 0x2 0x3 0x1 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x2 0x0 0x0 0x9 0x0 
send xfer complete event
dcd xfer 9
input ep int 
d->h :0x9 0x2 0x22 0x0 0x1 0x1 0x0 0xa0 0x32 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x2 0x0 0x0 0x22 0x0 
send xfer complete event
dcd xfer 22
input ep int 
d->h :0x9 0x2 0x22 0x0 0x1 0x1 0x0 0xa0 0x32 0x9 0x4 0x0 0x0 0x1 0x3 0x1 0x1 0x0 0x9 0x21 0x11 0x1 0x0 0x1 0x22 0x41 0x0 0x7 0x5 0x81 0x3 0x8 0x0 0xa 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x0 0x9 0x1 0x0 0x0 0x0 0x0 0x0 
send xfer complete event
edpt open
dcd xfer 0
input ep int 
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x21 0xa 0x0 0x0 0x0 0x0 0x0 0x0 
dcd xfer 0
input ep int 
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x81 0x6 0x0 0x22 0x0 0x0 0x81 0x0 
dcd xfer 40
input ep int 
d->h :0x5 0x1 0x9 0x6 0xa1 0x1 0x5 0x7 0x19 0xe0 0x29 0xe7 0x15 0x0 0x25 0x1 0x95 0x8 0x75 0x1 0x81 0x2 0x95 0x1 0x75 0x8 0x81 0x1 0x5 0x8 0x19 0x1 0x29 0x5 0x95 0x5 0x75 0x1 0x91 0x2 0x95 0x1 0x75 0x3 0x91 0x1 0x5 0x7 0x19 0x0 0x2a 0xff 0x0 0x15 0x0 0x26 0xff 0x0 0x95 0x6 0x75 0x8 0x81 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 1
input ep int 
d->h :0xc0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
output ep int 
send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x21 0x9 0x0 0x2 0x0 0x0 0x1 0x0 
dcd xfer 1
rxflvl int
output ep int 
send xfer complete event
dcd xfer 0
input ep int 
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x0 0x3 0x0 0x0 0xff 0x0 
dcd xfer 4
input ep int 
d->h :0x4 0x3 0x9 0x4 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x1 0x3 0x9 0x4 0xff 0x0 
send xfer complete event
dcd xfer 10
input ep int 
d->h :0x10 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int 
h->d: 0x80 0x6 0x2 0x3 0x9 0x4 0xff 0x0 
send xfer complete event
dcd xfer 1e
input ep int 
d->h :0x1e 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 0x20 0x0 0x44 0x0 0x65 0x0 0x76 0x0 0x69 0x0 0x63 0x0 0x65 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 0
rxflvl int
output ep int 
send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 
input ep int 
d->h :0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 
turn off txfe
input ep int 
edpt int send xfer complete event
http://www.zhongyajixie.com/news/62723.html

相关文章:

  • 加盟做地方门户网站网络营销是指什么
  • seo网站排名优化软件聚合搜索引擎接口
  • 阿里云 云虚拟主机 wordpressseo怎么优化武汉厂商
  • 外贸网站平台排行榜项目外包平台
  • 做的比较好的网站接广告推广的平台
  • 一百互联网站建设seo企业站收录
  • 大气的金融网站app开发公司有哪些
  • 温州建设局官方网站百度商城购物
  • 企业做网站价钱谷歌是如何运营的
  • 做网站要固定电话世界营销大师排名
  • 太平洋手机网官网seo网站的优化方案
  • 珠海市公司网站建设阿亮seo技术
  • 自己如何搭建网站seo关键词优化的技巧
  • 怎样建立网站有哪些流程搜索指数在线查询
  • 如何做美食的视频网站企业营销
  • 定制网站开发公司社交网络推广方法
  • 聊城专业网站建设公司百度app下载安装普通下载
  • 广州做网站技术网络维护培训班
  • thinkphp网站开发论坛推广的特点
  • 多语言免费网站建设长沙网络营销顾问
  • 可以做淘宝店铺开关灯网站计算机培训机构排名前十
  • 大江网站建设网站seo怎么做
  • 郑州网站权重自己做网络推广怎么做
  • 品牌手机网站开发公司哪家好上海网络推广公司网站
  • 网站开发的工作日志网址大全浏览器
  • wordpress返回前页手机优化专家
  • 济南行知网站制作电商运营一天都干啥
  • 特种作业操作证查询入口查询seo外链自动群发工具
  • 对网站建设的问题百度如何添加店铺位置信息
  • 濮阳网络科技有限公司南通百度网站快速优化