阅读:1901回复:0
为什么我的report descriptor 有问题?
各位大虾,
最近在写usb keyboard的程序,奇怪的是我写好firmware 端的程序後,在pc用98ddk中的hidview测试get report descriptor, 却总是不行,只读到了前面几个数据,然后报告说: collection must have corresponding end collection. 以下是它收到的数据 000000: 05 01 09 06 A1 01 05 07 但是,用windriver 中 get descriptor request命令 可以读到全部的report descriptor. 我的程序如下,请大虾们指教。(firmware 端的程序) WriteByte(0x05); WriteByte(0x01); // usage_page (generic desktop) WriteByte(0x09); WriteByte(0x06); // usage (keyboard) WriteByte(0xa1); WriteByte(0x01); // conllection (application) WriteByte(0x05); WriteByte(0x07); // usage_page (keyboard) WriteByte(0x19); WriteByte(0xe0); // usage_minimum (keyboard leftcontrol) WriteByte(0x29); WriteByte(0xe7); // usage_maximum (keyboard right GUI) WriteByte(0x15); WriteByte(0x00); // logical_minimum (0) WriteByte(0x25); WriteByte(0x01); // logical_maximum (1) WriteByte(0x75); WriteByte(0x01); // report_size (1) WriteByte(0x95); WriteByte(0x08); // report_count (8) WriteByte(0x81); WriteByte(0x02); // input (data,var,abs) WriteByte(0x81); WriteByte(0x01); // input (constant) reserve byte WriteByte(0x19); WriteByte(0x00); // usage_minimum (reserved (no event indicated)) WriteByte(0x29); WriteByte(0x65); // usage_maximum (keyboard application) WriteByte(0x15); WriteByte(0x00); // logical_minimum (0) WriteByte(0x25); WriteByte(0x65); // logical_maximum (101) WriteByte(0x75); WriteByte(0x08); // report_size (8) WriteByte(0x95); WriteByte(0x06); // report_count (6) WriteByte(0x81); WriteByte(0x00); // input (data,ary,abs) WriteByte(0x05); WriteByte(0x08); // usage_page (leds) WriteByte(0x19); WriteByte(0x01); // usage_minimum (num lock) WriteByte(0x29); WriteByte(0x05); // usage_maximum (kana) WriteByte(0x15); WriteByte(0x00); // logical_minimum (0) WriteByte(0x25); WriteByte(0x01); // logical_maximum (1) WriteByte(0x75); WriteByte(0x01); // report_size (1) WriteByte(0x95); WriteByte(0x05); // report_count (5) WriteByte(0x91); WriteByte(0x02); // output (data,var,abs) WriteByte(0x95); WriteByte(0x03); // report_count (1) WriteByte(0x91); WriteByte(0x01); // output (cnst,var,abs) WriteByte(0xc0); // end_collection |
|