usb hid 能否區(qū)分上位機(jī)系統(tǒng),如win、android、linux,會有那些不一致。主要是在window和android下需要區(qū)分使用不同的報(bào)表描述符,使用同一描述符時(shí),android下顯示鼠標(biāo),單window下反應(yīng)不正確。打算根據(jù)上位機(jī)系統(tǒng)加載不同的配置。
把報(bào)表描述符貼出來,測試情況
????????0x05,0x0d,0x09,0x02,0xa1,0x01,0x09,0x01,?? ?//android下顯示鼠標(biāo),windows下不起作用//0x05,0x01,0x09,0x02,0xa1,0x01,0x09,0x01,//windows下顯示鼠標(biāo)
?? ??? ?//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,
您好,不同系統(tǒng),USB枚舉的過程都是一樣的。報(bào)表描述符的處理流程不同系統(tǒng)或版本會略有區(qū)別,這個(gè)建議具體抓包看下,正常情況下是可以一套設(shè)備各系統(tǒng)全兼容。