usb之配置描述符

配置描述符的打印是有 设备描述符中一个成员 __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);
}

posted @ 2020-12-14 01:12  卷哭你  阅读(536)  评论(0编辑  收藏  举报