找回密码
 立即注册
查看: 216|回复: 0

一剑双雕A3示例代码中的小瑕疵纠正

[复制链接]
  • 打卡等级:以坛为家II
  • 打卡总天数:456
  • 最近打卡:2025-05-02 08:26:53
已绑定手机

27

主题

341

回帖

1691

积分

金牌会员

机长

积分
1691
发表于 2024-6-22 19:17:22 | 显示全部楼层 |阅读模式
usb_desc.c文件中:
  1. char code CONFIGDESC[141] =
  2. {
  3. // 配置描述符
  4.     0x09,                   //bLength(9);
  5.     0x02,                   //bDescriptorType(Configuration);
  6.     0x8d,0x00,              //wTotalLength(141);
  7.     0x04,                   //bNumInterfaces(4);
  8.     0x01,                   //bConfigurationValue(1);
  9.     0x00,                   //iConfiguration(0);
  10.     0x80,                   //bmAttributes(BUSPower);
  11.     0x32,                   //MaxPower(100mA);
  12. // 串口1 接口关联描述符
  13.     0x08,                   //bLength(8);
  14.     0x0b,                   //bDescriptorType(IAD);
  15.     0x00,                   //bFirstInterface(0);
  16.     0x02,                   //bInterfaceCount(2);
  17.     0x02,                   //bFunctionClass(Communication Device Class);
  18.     0x02,                   //bInterfaceSubClass(Abstract Control Model);
  19.     0x01,                   //bInterfaceProtocol(Common AT commands);
  20.     0x00,                   //iInterface(0);
复制代码

注释中有误,
bInterfaceSubClass应该是bFunctionSubClass,这一字节是关联接口功能子类描述符
bInterfaceProtocol应该是bFunctionProtocol,这一字节是关联接口功能协议描述符
iInterface应该是iFunction,这一字节是关联接口功能字符串描述符索引
业余撸代码,专业开飞机
回复

使用道具 举报 送花

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2025-5-3 05:31 , Processed in 0.812793 second(s), 46 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表