USB HID如何区分上位机系统

usb hid 能否区分上位机系统,如win、android、linux,会有那些不一致。主要是在window和android下需要区分使用不同的报表描述符,使用同一描述符时,android下显示鼠标,单window下反应不正确。打算根据上位机系统加载不同的配置。

把报表描述符贴出来,测试情况

        0x05,0x0d,0x09,0x02,0xa1,0x01,0x09,0x01,    //android下显示鼠标,windows下不起作用//0x05,0x01,0x09,0x02,0xa1,0x01,0x09,0x01,//windows下显示鼠标
        //0x05,0x0d,0x09,0x04,0xa1,0x01,0x09,0x22,//android下触摸,windows触摸
        //0x05,0x0d,0x09,0x04,0xa1,0x01,0x09,0x01,//android触摸,windows下指针
        //0x05,0x0d,0x09,0x04,0xa1,0x01,0x09,0x22,//android触摸,windows下指针
        0xa1,0x00,0x09,0x42,

        0x15,0x00,0x25,0x01,
        0x75,0x01,0x95,0x01,0x81,0x02,0x09,0x32,
        0x15,0x00,0x25,0x01,0x81,0x02,0x09,0x51,
        0x75,0x05,0x95,0x01,0x16,0x00,0x00,0x26,
        0x10,0x00,0x81,0x02,0x09,0x47,0x75,0x01,
        0x95,0x01,0x15,0x00,0x25,0x01,0x81,0x02,
        0x05,0x01,0x09,0x30,0x75,0x10,0x95,0x01,
        0x55,0x0D,0x65,0x33,0x35,0x00,0x46,0x60,
        0x17,0x26,0xFF,0x0F,0x81,0x02,0x09,0x31,
        0x75,0x10,0x95,0x01,0x55,0x0D,0x65,0x33,
        0x35,0x00,0x46,0x26,0x0E,0x26,0xFF,0x0F,
        0x81,0x02,0x05,0x0D,0x09,0x55,0x25,0x08,
        0x75,0x08,0x95,0x01,0xB1,0x02,0xC0,0xC0,


您好,不同系统,USB枚举的过程都是一样的。报表描述符的处理流程不同系统或版本会略有区别,这个建议具体抓包看下,正常情况下是可以一套设备各系统全兼容。


只有登录才能回复,可以选择微信账号登录