Неправильный дескриптор отчета и структура данных отчета?

Я работаю над дескриптором отчета HID, который я использую, изменив пример кода здесь:
https://code.msdn.microsoft.com/WudfVhidmini-Sample-b304f83a/sourcecode?fileId=42918&pathId = 205101617 (по ссылке открывается файл queue.cpp, в котором находится большая часть моего кода чтения / записи для драйвера и дескриптор отчета по умолчанию hid). Мой обновленный дескриптор отчета, который у меня есть в драйвере (по состоянию на 11.05.2015):

  HID_REPORT_DESCRIPTOR           G_DefaultReportDescriptor[] = {
0x06, 0x00,0xFF,     // (GLOBAL) USAGE_PAGE         0xFF00 Vendor-defined
0x09, 0x01,       // (LOCAL)  USAGE              0xFF000001
0xA1, 0x01,        //(MAIN)   COLLECTION         0x01 Application (Usage=0xFF000001: Page=Vendor-defined, Usage=, Type=)
0x85, 0x0F,         // (GLOBAL) REPORT_ID          0x0F (15)
0x09, 0x01,         // (LOCAL)  USAGE              0xFF000001
0x15, 0x00,        //  (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
0x26, 0xFF,0x00,      //  (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)
0x75, 0x08,          //(GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
0x96, 0x09, 0x00,        //(GLOBAL) REPORT_COUNT       0x0009 (9) Number of fields
0xB1, 0x00,         // (MAIN)   FEATURE            0x00000000 (9 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
0x09, 0x01,         // (LOCAL)  USAGE              0xFF000001
0x96, 0x01, 0x00,       // (GLOBAL) REPORT_COUNT       0x0001 (1) Number of fields
0x81, 0x00,        //  (MAIN)   INPUT              0x00000000 (1 field x 8 bits) 0=Data 0=Array 0=Absolute 0=Ignored 0=Ignored 0=PrefState 0=NoNull
0x09, 0x01,          //(LOCAL)  USAGE              0xFF000001
0x96, 0x07, 0x00,       // (GLOBAL) REPORT_COUNT       0x0007 (7) Number of fields
0x91, 0x00,        //  (MAIN)   OUTPUT             0x00000000 (7 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
0xC0,          // (MAIN)   END_COLLECTION     Application
0x05, 0x01,       // (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
0x09, 0x02,       // (LOCAL)  USAGE              0x00010002 Mouse (CA=Application Collection)
0xA1, 0x01,       // (MAIN)   COLLECTION         0x01 Application (Usage=0x00010002: Page=Generic Desktop Page, Usage=Mouse, Type=CA)
0x09, 0x01,       // (LOCAL)  USAGE              0x00010001 Pointer (CP=Physical Collection)
0xA1, 0x02,       // (MAIN)   COLLECTION         0x02 Logical (Usage=0x00010001: Page=Generic Desktop Page, Usage=Pointer, Type=CP) <-- Warning: USAGE type should be CL (Logical)
0x05, 0x0A,       // (GLOBAL) USAGE_PAGE         0x000A Ordinal Page
0x09, 0x01,       // (LOCAL)  USAGE              0x000A0001 Instance 1 (UM=Usage Modifier)
0x85, 0x01,       // (GLOBAL) REPORT_ID          0x01 (1)
0xA1, 0x00,      //  (MAIN)   COLLECTION         0x00 Physical (Usage=0x000A0001: Page=Ordinal Page, Usage=Instance 1, Type=UM) <-- Warning: USAGE type should be CP (Physical)
0x05, 0x09,      //    (GLOBAL) USAGE_PAGE         0x0009 Button Page
0x19, 0x01,      // (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
0x29, 0x03,      //  (LOCAL)  USAGE_MAXIMUM      0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
0x15, 0x00,     //  (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
0x25, 0x01,     //  (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)
0x75, 0x01,     //   (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field
0x95, 0x03,      //  (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields
0x81, 0x02,        // (MAIN)   INPUT              0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
0x95, 0x05,      //   (GLOBAL)REPORT_COUNT       0x05 (5) Number of fields
0x81, 0x03,       //   (MAIN)INPUT              0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01,       //       (GLOBAL)USAGE_PAGE         0x0001 Generic Desktop Page
0x09, 0x30,       //       (LOCAL)USAGE              0x00010030 X(DV = Dynamic Value)
0x09, 0x31,       //       (LOCAL)USAGE              0x00010031 Y(DV = Dynamic Value)
0x15, 0x81,       //      (GLOBAL)LOGICAL_MINIMUM    0x81 (-127)
0x25, 0x7F,       //       (GLOBAL)LOGICAL_MAXIMUM    0x7F (127)
0x75, 0x08,       //       (GLOBAL)REPORT_SIZE        0x08 (8) Number of bits per field
0x95, 0x02,       //       (GLOBAL)REPORT_COUNT       0x02 (2) Number of fields
0x81, 0x06,       //       (MAIN)INPUT              0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0,  // END_COLLECTION     Physical
0x05, 0x0A,        //   (GLOBAL)USAGE_PAGE         0x000A Ordinal Page
0x09, 0x02,         //   (LOCAL)USAGE              0x000A0002 Instance 2 (UM = Usage Modifier)
0x85, 0x02,        //    (GLOBAL)REPORT_ID          0x02 (2)
0xA1, 0x00,        //    (MAIN)COLLECTION         0x00 Physical(Usage = 0x000A0002: Page = Ordinal Page, Usage = Instance 2, Type = UM) < --Warning: USAGE type should be CP(Physical)
0x05, 0x09,         //     (GLOBAL)USAGE_PAGE         0x0009 Button Page
0x19, 0x01,         //     (LOCAL)USAGE_MINIMUM      0x00090001 Button 1 Primary / trigger(MULTI = Selector, On / Off, Momentary, or One Shot)
0x29, 0x03,         //     (LOCAL)USAGE_MAXIMUM      0x00090003 Button 3 Tertiary(MULTI = Selector, On / Off, Momentary, or One Shot)
0x15, 0x00,       //       (GLOBAL)LOGICAL_MINIMUM    0x00 (0)
0x25, 0x01,       //       (GLOBAL)LOGICAL_MAXIMUM    0x01 (1)
0x75, 0x01,       //       (GLOBAL)REPORT_SIZE        0x01 (1) Number of bits per field
0x95, 0x03,       //       (GLOBAL)REPORT_COUNT       0x03 (3) Number of fields
0x81, 0x02,       //       (MAIN)INPUT              0x00000002 (3 fields x 1 bit) 0 = Data 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x95, 0x05,       //       (GLOBAL)REPORT_COUNT       0x05 (5) Number of fields
0x81, 0x03,       //       (MAIN)INPUT              0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01,       //       (GLOBAL)USAGE_PAGE         0x0001 Generic Desktop Page
0x09, 0x30,       //       (LOCAL)USAGE              0x00010030 X(DV = Dynamic Value)
0x09, 0x31,       //       (LOCAL)USAGE              0x00010031 Y(DV = Dynamic Value)
0x15, 0x81,       //       (GLOBAL)LOGICAL_MINIMUM    0x81 (-127)
0x25, 0x7F,       //       (GLOBAL)LOGICAL_MAXIMUM    0x7F (127)
0x75, 0x08,       //       (GLOBAL)REPORT_SIZE        0x08 (8) Number of bits per field
0x95, 0x02,       //       (GLOBAL)REPORT_COUNT       0x02 (2) Number of fields
0x81, 0x06,           //   (MAIN)INPUT              0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0,       // END_COLLECTION     Physical
0x05, 0x0A,         //   (GLOBAL)USAGE_PAGE         0x000A Ordinal Page
0x09, 0x03,         //   (LOCAL)USAGE              0x000A0003 Instance 3 (UM = Usage Modifier)
0x85, 0x03,         //   (GLOBAL)REPORT_ID          0x03 (3)
0xA1, 0x00,           // (MAIN)COLLECTION         0x00 Physical(Usage = 0x000A0003: Page = Ordinal Page, Usage = Instance 3, Type = UM) < --Warning: USAGE type should be CP(Physical)
0x05, 0x09,           //   (GLOBAL)USAGE_PAGE         0x0009 Button Page
0x19, 0x01,           //   (LOCAL)USAGE_MINIMUM      0x00090001 Button 1 Primary / trigger(MULTI = Selector, On / Off, Momentary, or One Shot)
0x29, 0x03,           //   (LOCAL)USAGE_MAXIMUM      0x00090003 Button 3 Tertiary(MULTI = Selector, On / Off, Momentary, or One Shot)
0x15, 0x00,             // (GLOBAL)LOGICAL_MINIMUM    0x00 (0)
0x25, 0x01,             // (GLOBAL)LOGICAL_MAXIMUM    0x01 (1)
0x75, 0x01,             // (GLOBAL)REPORT_SIZE        0x01 (1) Number of bits per field
0x95, 0x03,             // (GLOBAL)REPORT_COUNT       0x03 (3) Number of fields
0x81, 0x02,             // (MAIN)INPUT              0x00000002 (3 fields x 1 bit) 0 = Data 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x95, 0x05,            //  (GLOBAL)REPORT_COUNT       0x05 (5) Number of fields
0x81, 0x03,            //  (MAIN)INPUT              0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01,            //  (GLOBAL)USAGE_PAGE         0x0001 Generic Desktop Page
0x09, 0x30,            //  (LOCAL)USAGE              0x00010030 X(DV = Dynamic Value)
0x09, 0x31,            //  (LOCAL)USAGE              0x00010031 Y(DV = Dynamic Value)
0x15, 0x81,            //  (GLOBAL)LOGICAL_MINIMUM    0x81 (-127)
0x25, 0x7F,            //  (GLOBAL)LOGICAL_MAXIMUM    0x7F (127)
0x75, 0x08,            //  (GLOBAL)REPORT_SIZE        0x08 (8) Number of bits per field
0x95, 0x02,           //  (GLOBAL)REPORT_COUNT       0x02 (2) Number of fields
0x81, 0x06,           //   (MAIN)INPUT              0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0,        //   END_COLLECTION     Physical
0x05, 0x0A,           // (GLOBAL)USAGE_PAGE         0x000A Ordinal Page
0x09, 0x04,          //  (LOCAL)USAGE              0x000A0004 Instance 4 (UM = Usage Modifier)
0x85, 0x04,           // (GLOBAL)REPORT_ID          0x04 (4)
0xA1, 0x00,           // (MAIN)COLLECTION         0x00 Physical(Usage = 0x000A0004: Page = Ordinal Page, Usage = Instance 4, Type = UM) < --Warning: USAGE type should be CP(Physical)
0x05, 0x09,             // (GLOBAL)USAGE_PAGE         0x0009 Button Page
0x19, 0x01,            //  (LOCAL)USAGE_MINIMUM      0x00090001 Button 1 Primary / trigger(MULTI = Selector, On / Off, Momentary, or One Shot)
0x29, 0x03,            //  (LOCAL)USAGE_MAXIMUM      0x00090003 Button 3 Tertiary(MULTI = Selector, On / Off, Momentary, or One Shot)
0x15, 0x00,            //  (GLOBAL)LOGICAL_MINIMUM    0x00 (0)
0x25, 0x01,            //  (GLOBAL)LOGICAL_MAXIMUM    0x01 (1)
0x75, 0x01,            //  (GLOBAL)REPORT_SIZE        0x01 (1) Number of bits per field
0x95, 0x03,             // (GLOBAL)REPORT_COUNT       0x03 (3) Number of fields
0x81, 0x02,             // (MAIN)INPUT              0x00000002 (3 fields x 1 bit) 0 = Data 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x95, 0x05,             // (GLOBAL)REPORT_COUNT       0x05 (5) Number of fields
0x81, 0x03,            //  (MAIN)INPUT              0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01,            //  (GLOBAL)USAGE_PAGE         0x0001 Generic Desktop Page
0x09, 0x30,            //  (LOCAL)USAGE              0x00010030 X(DV = Dynamic Value)
0x09, 0x31,            //  (LOCAL)USAGE              0x00010031 Y(DV = Dynamic Value)
0x15, 0x81,            //  (GLOBAL)LOGICAL_MINIMUM    0x81 (-127)
0x25, 0x7F,            //  (GLOBAL)LOGICAL_MAXIMUM    0x7F (127)
0x75, 0x08,            //  (GLOBAL)REPORT_SIZE        0x08 (8) Number of bits per field
0x95, 0x02,           //   (GLOBAL)REPORT_COUNT       0x02 (2) Number of fields
0x81, 0x06,           //   (MAIN)INPUT              0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0,        //   END_COLLECTION     Physical
0xC0,  // END_COLLECTION     Logical
0xC0,  // END_COLLECTION     Application
};

Вот структура отчета по умолчанию, которая пришла с образцом, который я сейчас использую (пока я не пойму, что я могу изменить в нем):

typedef struct _HIDMINI_INPUT_REPORT {

UCHAR ReportId;

UCHAR Data;

} HIDMINI_INPUT_REPORT, *PHIDMINI_INPUT_REPORT;

//
// output to device from system
//
typedef struct _HIDMINI_OUTPUT_REPORT {

UCHAR ReportId;

UCHAR Data;

USHORT Pad1;

ULONG Pad2;

} HIDMINI_OUTPUT_REPORT, *PHIDMINI_OUTPUT_REPORT;

Моя проблема в 4 раза:

  1. Мне нужно передать данные из коллекции элементов управления (первая коллекция до запуска комментария к устройствам мыши) для 4 устройств мыши в коллекции мыши. Как мне написать дескриптор отчета, чтобы сделать это, или мне нужен код, чтобы сделать это?

  2. Как мой код структуры отчета будет выглядеть для чтения / записи в структуру элемента управления из Windows.Devices.HumanInterfaceDevice?

  3. Должен ли я отправлять каждый дескриптор отчета, как это делает vmulti, за исключением всех в одном цикле?

  4. Сколько из вышеперечисленного было бы необходимо, если бы я хотел имитировать / эмулировать устройства мыши для SDK для многоточечной мыши или другого приложения для нескольких мышей? (отправка ввода в приложение с несколькими мышками)

Примечание: я планирую использовать https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.humaninterfacedevice.aspx Функции класса для чтения / записи с 4-х мышиных устройств, определенных выше, и поэтому я собираюсь разобраться в этом. Но класс на MSDN ясно заявляет, что я не могу писать на устройства мыши напрямую. Если бы это было так, я бы не писал здесь. На случай, если возникнет вопрос: да, речь идет о введении ввода в наборы мыши, чтобы я мог заставить их работать с мульти-мышиными приложениями. Приведенная выше ссылка на WudfVhidmin-Sample — это не мой код, а пример, который я использую для написания своего драйвера.

Если я уберу часть перед первым заключительным комментарием к коллекции, она создаст три мышиных устройства, но это все.

0

Решение

Похоже, вы хотите определить дескриптор отчета для размещения четырех указателей мыши (по крайней мере, это часть вашего вопроса?). Спецификация дескриптора отчета HID допускает концепцию «Экземпляры», поэтому я думаю, что попытка чего-то наподобие следующего дескриптора отчета может стоить исследовать. Я понятия не имею, будет ли это работать на практике, но он основан на (довольно странном ИМХО) примере в «Приложении A.5 Несколько экземпляров элемента управления» в Спецификация таблиц использования HID 1.12.

Насколько я вижу, нет способа определить экземпляр один раз и каким-то образом сгенерировать четыре из них. Кажется, вам приходится дублировать дескриптор отчета для каждого экземпляра.

Стоит выстрел в любом случае.

Следующее было создано некоторым кодом, который я написал некоторое время назад под названием hidrdd чтобы помочь мне декодировать HID дескрипторы отчетов:

//--------------------------------------------------------------------------------
// Decoded Application Collection
//--------------------------------------------------------------------------------

/*
06 00FF      (GLOBAL) USAGE_PAGE         0xFF00 Vendor-defined
09 01        (LOCAL)  USAGE              0xFF000001
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0xFF000001: Page=Vendor-defined, Usage=, Type=)
85 0F          (GLOBAL) REPORT_ID          0x0F (15)
09 01          (LOCAL)  USAGE              0xFF000001
15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
26 FF00        (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)
75 08          (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
96 0900        (GLOBAL) REPORT_COUNT       0x0009 (9) Number of fields
B1 00          (MAIN)   FEATURE            0x00000000 (9 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
09 01          (LOCAL)  USAGE              0xFF000001
96 0100        (GLOBAL) REPORT_COUNT       0x0001 (1) Number of fields
81 00          (MAIN)   INPUT              0x00000000 (1 field x 8 bits) 0=Data 0=Array 0=Absolute 0=Ignored 0=Ignored 0=PrefState 0=NoNull
09 01          (LOCAL)  USAGE              0xFF000001
96 0700        (GLOBAL) REPORT_COUNT       0x0007 (7) Number of fields
91 00          (MAIN)   OUTPUT             0x00000000 (7 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0           (MAIN)   END_COLLECTION     Application
*/

//--------------------------------------------------------------------------------
// Decoded Application Collection
//--------------------------------------------------------------------------------

/*
05 01        (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
09 02        (LOCAL)  USAGE              0x00010002 Mouse (CA=Application Collection)
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00010002: Page=Generic Desktop Page, Usage=Mouse, Type=CA)
09 01          (LOCAL)  USAGE              0x00010001 Pointer (CP=Physical Collection)
A1 02          (MAIN)   COLLECTION         0x02 Logical (Usage=0x00010001: Page=Generic Desktop Page, Usage=Pointer, Type=CP) <-- Warning: USAGE type should be CL (Logical)
05 0A            (GLOBAL) USAGE_PAGE         0x000A Ordinal Page
09 01            (LOCAL)  USAGE              0x000A0001 Instance 1 (UM=Usage Modifier)
85 01            (GLOBAL) REPORT_ID          0x01 (1)
A1 00            (MAIN)   COLLECTION         0x00 Physical (Usage=0x000A0001: Page=Ordinal Page, Usage=Instance 1, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09              (GLOBAL) USAGE_PAGE         0x0009 Button Page
19 01              (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03              (LOCAL)  USAGE_MAXIMUM      0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00              (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
25 01              (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)
75 01              (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field
95 03              (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields
81 02              (MAIN)   INPUT              0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05              (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields
81 03              (MAIN)   INPUT              0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01              (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
09 30              (LOCAL)  USAGE              0x00010030 X (DV=Dynamic Value)
09 31              (LOCAL)  USAGE              0x00010031 Y (DV=Dynamic Value)
15 81              (GLOBAL) LOGICAL_MINIMUM    0x81 (-127)
25 7F              (GLOBAL) LOGICAL_MAXIMUM    0x7F (127)
75 08              (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
95 02              (GLOBAL) REPORT_COUNT       0x02 (2) Number of fields
81 06              (MAIN)   INPUT              0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0               (MAIN)   END_COLLECTION     Physical
05 0A            (GLOBAL) USAGE_PAGE         0x000A Ordinal Page
09 02            (LOCAL)  USAGE              0x000A0002 Instance 2 (UM=Usage Modifier)
85 02            (GLOBAL) REPORT_ID          0x02 (2)
A1 00            (MAIN)   COLLECTION         0x00 Physical (Usage=0x000A0002: Page=Ordinal Page, Usage=Instance 2, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09              (GLOBAL) USAGE_PAGE         0x0009 Button Page
19 01              (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03              (LOCAL)  USAGE_MAXIMUM      0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00              (GLOBAL) LOGICAL_MINIMUM    0x00 (0)
25 01              (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)
75 01              (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field
95 03              (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields
81 02              (MAIN)   INPUT              0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05              (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields
81 03              (MAIN)   INPUT              0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01              (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
09 30              (LOCAL)  USAGE              0x00010030 X (DV=Dynamic Value)
09 31              (LOCAL)  USAGE              0x00010031 Y (DV=Dynamic Value)
15 81              (GLOBAL) LOGICAL_MINIMUM    0x81 (-127)
25 7F              (GLOBAL) LOGICAL_MAXIMUM    0x7F (127)
75 08              (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
95 02              (GLOBAL) REPORT_COUNT       0x02 (2) Number of fields
81 06              (MAIN)   INPUT              0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0               (MAIN)   END_COLLECTION     Physical
05 0A            (GLOBAL) USAGE_PAGE         0x000A Ordinal Page
09 03            (LOCAL)  USAGE              0x000A0003 Instance 3 (UM=Usage Modifier)
85 03            (GLOBAL) REPORT_ID          0x03 (3)
A1 00            (MAIN)   COLLECTION         0x00 Physical (Usage=0x000A0003: Page=Ordinal Page, Usage=Instance 3, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09              (GLOBAL) USAGE_PAGE         0x0009 Button Page
19 01              (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03              (LOCAL)  USAGE_MAXIMUM      0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00              (GLOBAL) LOGICAL_MINIMUM    0x00 (0)
25 01              (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)
75 01              (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field
95 03              (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields
81 02              (MAIN)   INPUT              0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05              (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields
81 03              (MAIN)   INPUT              0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01              (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
09 30              (LOCAL)  USAGE              0x00010030 X (DV=Dynamic Value)
09 31              (LOCAL)  USAGE              0x00010031 Y (DV=Dynamic Value)
15 81              (GLOBAL) LOGICAL_MINIMUM    0x81 (-127)
25 7F              (GLOBAL) LOGICAL_MAXIMUM    0x7F (127)
75 08              (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
95 02              (GLOBAL) REPORT_COUNT       0x02 (2) Number of fields
81 06              (MAIN)   INPUT              0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0               (MAIN)   END_COLLECTION     Physical
05 0A            (GLOBAL) USAGE_PAGE         0x000A Ordinal Page
09 04            (LOCAL)  USAGE              0x000A0004 Instance 4 (UM=Usage Modifier)
85 04            (GLOBAL) REPORT_ID          0x04 (4)
A1 00            (MAIN)   COLLECTION         0x00 Physical (Usage=0x000A0004: Page=Ordinal Page, Usage=Instance 4, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09              (GLOBAL) USAGE_PAGE         0x0009 Button Page
19 01              (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03              (LOCAL)  USAGE_MAXIMUM      0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00              (GLOBAL) LOGICAL_MINIMUM    0x00 (0)
25 01              (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)
75 01              (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field
95 03              (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields
81 02              (MAIN)   INPUT              0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05              (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields
81 03              (MAIN)   INPUT              0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01              (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
09 30              (LOCAL)  USAGE              0x00010030 X (DV=Dynamic Value)
09 31              (LOCAL)  USAGE              0x00010031 Y (DV=Dynamic Value)
15 81              (GLOBAL) LOGICAL_MINIMUM    0x81 (-127)
25 7F              (GLOBAL) LOGICAL_MAXIMUM    0x7F (127)
75 08              (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field
95 02              (GLOBAL) REPORT_COUNT       0x02 (2) Number of fields
81 06              (MAIN)   INPUT              0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0               (MAIN)   END_COLLECTION     Physical
C0             (MAIN)   END_COLLECTION     Logical
C0           (MAIN)   END_COLLECTION     Application

Это должно соответствовать объявлениям C, таким как:

//--------------------------------------------------------------------------------
// Vendor-defined featureReport 0F (Device <-> Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x0F (15)
uint8_t  VEN_VendorDefined[9];                     // Value = 0 to 255
} featureReport0F_t;//--------------------------------------------------------------------------------
// Vendor-defined inputReport 0F (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x0F (15)
uint8_t  VEN_VendorDefined;                        // Value = 0 to 255
} inputReport0F_t;//--------------------------------------------------------------------------------
// Vendor-defined outputReport 0F (Device <-- Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x0F (15)
uint8_t  VEN_VendorDefined[7];                     // Value = 0 to 255
} outputReport0F_t;//--------------------------------------------------------------------------------
// Button Page inputReport 01 (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x01 (1)
// Collection: Mouse Pointer Instance1
uint8_t  BTN_MousePointerInstance1Button1 : 1;     // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t  BTN_MousePointerInstance1Button2 : 1;     // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t  BTN_MousePointerInstance1Button3 : 1;     // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
int8_t   GD_MousePointerInstance1X;                // Usage 0x00010030: X, Value = -127 to 127
int8_t   GD_MousePointerInstance1Y;                // Usage 0x00010031: Y, Value = -127 to 127
} inputReport01_t;//--------------------------------------------------------------------------------
// Button Page inputReport 02 (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x02 (2)
// Collection: Mouse Pointer Instance2
uint8_t  BTN_MousePointerInstance2Button1 : 1;     // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t  BTN_MousePointerInstance2Button2 : 1;     // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t  BTN_MousePointerInstance2Button3 : 1;     // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
int8_t   GD_MousePointerInstance2X;                // Usage 0x00010030: X, Value = -127 to 127
int8_t   GD_MousePointerInstance2Y;                // Usage 0x00010031: Y, Value = -127 to 127
} inputReport02_t;//--------------------------------------------------------------------------------
// Button Page inputReport 03 (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x03 (3)
// Collection: Mouse Pointer Instance3
uint8_t  BTN_MousePointerInstance3Button1 : 1;     // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t  BTN_MousePointerInstance3Button2 : 1;     // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t  BTN_MousePointerInstance3Button3 : 1;     // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
int8_t   GD_MousePointerInstance3X;                // Usage 0x00010030: X, Value = -127 to 127
int8_t   GD_MousePointerInstance3Y;                // Usage 0x00010031: Y, Value = -127 to 127
} inputReport03_t;//--------------------------------------------------------------------------------
// Button Page inputReport 04 (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
uint8_t  reportId;                                 // Report ID = 0x04 (4)
// Collection: Mouse Pointer Instance4
uint8_t  BTN_MousePointerInstance4Button1 : 1;     // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t  BTN_MousePointerInstance4Button2 : 1;     // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t  BTN_MousePointerInstance4Button3 : 1;     // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
uint8_t  : 1;                                      // Pad
int8_t   GD_MousePointerInstance4X;                // Usage 0x00010030: X, Value = -127 to 127
int8_t   GD_MousePointerInstance4Y;                // Usage 0x00010031: Y, Value = -127 to 127
} inputReport04_t;
0

Другие решения


По вопросам рекламы [email protected]