zoukankan      html  css  js  c++  java
  • 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 ",config.bLength);
    printf("config.bDescriptorType is %d ",config.bDescriptorType);
    printf("config.wTotalLength is %d ",config.wTotalLength);
    printf("config.bNumInterfaces is %d ",config.bNumInterfaces);
    printf("config.bConfigurationValue is %d ",config.bConfigurationValue);
    printf("config.iConfiguration is %d ",config.iConfiguration);
    printf("config.bmAttributes is %d ",config.bmAttributes);
    printf("config.bMaxPower is %d ",config.bMaxPower);
    }

    一勤天下无难事。
  • 相关阅读:
    在 MAC 下配置 Nginx
    Color Schema 配色随笔
    .Net与 WebAssembly 随笔
    关于Xamarin、Qml、数据绑定、MVC、MVVM 相关的散讲
    用Nuget部署程序包
    Qt3D
    Qt3D Shader
    Qt QML 2D shader
    LearnOpenGL
    Qt3D 5.9 and future
  • 原文地址:https://www.cnblogs.com/nowroot/p/14131303.html
Copyright © 2011-2022 走看看