nowroot

配置描述符的打印是有 设备描述符中一个成员 __u8 bNumConfigurations; 打印出来的
struct usb_config_descriptor {
__u8 bLength;
__u8 bDescriptorType;

__le16 wTotalLength;
__u8  bNumInterfaces;
__u8  bConfigurationValue;
__u8  iConfiguration;
__u8  bmAttributes;
__u8  bMaxPower;

} attribute ((packed));

struct usb_config_descriptor config;

for(i=0;i<desc.bNumConfigurations;i++)
{
printf("config.bLength %d\n",config.bLength);
printf("config.bDescriptorType is %d\n",config.bDescriptorType);
printf("config.wTotalLength is %d\n",config.wTotalLength);
printf("config.bNumInterfaces is %d\n",config.bNumInterfaces);
printf("config.bConfigurationValue is %d\n",config.bConfigurationValue);
printf("config.iConfiguration is %d\n",config.iConfiguration);
printf("config.bmAttributes is %d\n",config.bmAttributes);
printf("config.bMaxPower is %d\n",config.bMaxPower);
}

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-11-02
  • 2021-08-14
  • 2021-11-23
  • 2021-11-23
  • 2021-12-03
  • 2021-04-05
猜你喜欢
  • 2021-11-07
  • 2021-11-07
  • 2021-07-13
  • 2021-11-07
  • 2021-09-17
  • 2021-04-29
相关资源
相似解决方案