Подскажите, пожалуйста, какой дескриптор образуется в этом коде:
/*
* Now the buttons
*/
for( Idx = 0x0; Idx < DeviceExtension->nButtons; Idx++ )
{
/* Report size is 1 bit for button */
NEXT_BYTE(pucReport, HIDP_GLOBAL_REPORT_SIZE);
NEXT_BYTE(pucReport, 0x1);
NEXT_BYTE(pucReport, HIDP_LOCAL_USAGE_4);
NEXT_BYTE(pucReport, (UCHAR)(Idx + 1) );
NEXT_BYTE(pucReport, 0x0);
NEXT_BYTE(pucReport, HID_USAGE_PAGE_BUTTON);
NEXT_BYTE(pucReport, 0x0);
/* Data field */
NEXT_BYTE(pucReport, HIDP_MAIN_INPUT_1);
NEXT_BYTE(pucReport, ITEM_BUTTON);
/* 7 bits of constant data */
NEXT_BYTE(pucReport, HIDP_GLOBAL_REPORT_SIZE);
NEXT_BYTE(pucReport, 0x7);
NEXT_BYTE(pucReport, HIDP_MAIN_INPUT_1);
NEXT_BYTE(pucReport, ITEM_PADDING);
HGM_DBGPRINT( FILE_HIDJOY | HGM_GEN_REPORT, \
("HGM_GenerateReport:Button %u on",Idx ) ) ;
}
if( Idx < MAX_BUTTONS )
{
/* Constant report for 8 * unused buttons bits */
NEXT_BYTE(pucReport, HIDP_GLOBAL_REPORT_SIZE);
NEXT_BYTE(pucReport, (UCHAR)((MAX_BUTTONS-Idx)*8) );
/* Constant Field */
NEXT_BYTE(pucReport, HIDP_MAIN_INPUT_1);
NEXT_BYTE(pucReport, ITEM_PADDING);
Обычные дескрипторы, вроде этого:
HID_USAGE_PAGE(BUTTONS),
HID_USAGE_MINIMUM(1, 1),
HID_USAGE_MAXIMUM(1, 3),
HID_LOGICAL_MINIMUM(1, 0),
HID_LOGICAL_MAXIMUM(1, 1),
HID_REPORT_COUNT(3),
HID_REPORT_SIZE(1),
HID_INPUT(DATA, VARIABLE, ABSOLUTE),
HID_REPORT_COUNT(1),
HID_REPORT_SIZE(5),
HID_INPUT(CONSTANT),
почему-то вызывают сбой в других драйверах винды