c++ - Incorrect report descriptor and report data structure? -
i working on hid report descriptor using modifying sample code here: https://code.msdn.microsoft.com/wudfvhidmini-sample-b304f83a/sourcecode?fileid=42918&pathid=205101617 (the link opens queue.cpp file of read/write code driver , default hid report descriptor). updated report descriptor have far in driver (as of 5/11/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 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 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 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 1 shot) 0x29, 0x03, // (local) usage_maximum 0x00090003 button 3 tertiary (multi=selector, on/off, momentary, or 1 shot) 0x15, 0x00, // (global) logical_minimum 0x00 (0) <-- redundant: logical_minimum 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 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 1 shot) 0x29, 0x03, // (local)usage_maximum 0x00090003 button 3 tertiary(multi = selector, on / off, momentary, or 1 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 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 1 shot) 0x29, 0x03, // (local)usage_maximum 0x00090003 button 3 tertiary(multi = selector, on / off, momentary, or 1 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 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 1 shot) 0x29, 0x03, // (local)usage_maximum 0x00090003 button 3 tertiary(multi = selector, on / off, momentary, or 1 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 };
here's default report structure came sample using (until figure can change in it):
typedef struct _hidmini_input_report { uchar reportid; uchar data; } hidmini_input_report, *phidmini_input_report; // // output device system // typedef struct _hidmini_output_report { uchar reportid; uchar data; ushort pad1; ulong pad2; } hidmini_output_report, *phidmini_output_report;
my problem 4 fold:
i need pass data down control collection (the first collection before start of mouse devices comment reached) 4 mouse devices down mouse collections. how write report descriptor or need code this?
how report structure code reading/writing control structure windows.devices.humaninterfacedevice?
should send each report descriptor vmulti except in 1 loop?
- how of above necessary if wanting simulate/emulate mouse devices multi-point mouse sdk or multi mouse application? (sending input multi-mouse application)
note: plan on using https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.humaninterfacedevice.aspx class functions read/write 4 mouse devices defined above , why going trouble figure out stuff. class on msdn states cannot write mouse devices directly. if so, have not been writing here. in-case question comes up: yes, injecting input mouse collections can them work multi-mouse applications. above link wudfvhidmin-sample not code sample using write driver.
if take out part before first end collection comment creates 3 mouse devices that's it.
it sounds wanting define report descriptor accommodate 4 physical mouse pointers (at least part of question?). hid report descriptor specification allows concept of "instances", think trying following report descriptor might worth investigating. i have no idea whether work in practice, based on (rather flakey imho) example in "appendix a.5 multiple instances of control" in hid usage tables 1.12 specification.
as far can see there no way define instance once , somehow generate 4 of them. seem have duplicate report descriptor each instance.
worth shot anyway.
the following produced code wrote while called hidrdd me decode hid report descriptors:
//-------------------------------------------------------------------------------- // 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 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 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 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 1 shot) 29 03 (local) usage_maximum 0x00090003 button 3 tertiary (multi=selector, on/off, momentary, or 1 shot) 15 00 (global) logical_minimum 0x00 (0) <-- redundant: logical_minimum 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 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 1 shot) 29 03 (local) usage_maximum 0x00090003 button 3 tertiary (multi=selector, on/off, momentary, or 1 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 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 1 shot) 29 03 (local) usage_maximum 0x00090003 button 3 tertiary (multi=selector, on/off, momentary, or 1 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 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 1 shot) 29 03 (local) usage_maximum 0x00090003 button 3 tertiary (multi=selector, on/off, momentary, or 1 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
this should correspond c declarations like:
//-------------------------------------------------------------------------------- // vendor-defined featurereport 0f (device <-> host) //-------------------------------------------------------------------------------- typedef struct { uint8_t reportid; // report id = 0x0f (15) uint8_t ven_vendordefined[9]; // value = 0 255 } featurereport0f_t; //-------------------------------------------------------------------------------- // vendor-defined inputreport 0f (device --> host) //-------------------------------------------------------------------------------- typedef struct { uint8_t reportid; // report id = 0x0f (15) uint8_t ven_vendordefined; // value = 0 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 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 1 uint8_t btn_mousepointerinstance1button2 : 1; // usage 0x00090002: button 2 secondary, value = 0 1 uint8_t btn_mousepointerinstance1button3 : 1; // usage 0x00090003: button 3 tertiary, value = 0 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 127 int8_t gd_mousepointerinstance1y; // usage 0x00010031: y, value = -127 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 1 uint8_t btn_mousepointerinstance2button2 : 1; // usage 0x00090002: button 2 secondary, value = 0 1 uint8_t btn_mousepointerinstance2button3 : 1; // usage 0x00090003: button 3 tertiary, value = 0 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 127 int8_t gd_mousepointerinstance2y; // usage 0x00010031: y, value = -127 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 1 uint8_t btn_mousepointerinstance3button2 : 1; // usage 0x00090002: button 2 secondary, value = 0 1 uint8_t btn_mousepointerinstance3button3 : 1; // usage 0x00090003: button 3 tertiary, value = 0 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 127 int8_t gd_mousepointerinstance3y; // usage 0x00010031: y, value = -127 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 1 uint8_t btn_mousepointerinstance4button2 : 1; // usage 0x00090002: button 2 secondary, value = 0 1 uint8_t btn_mousepointerinstance4button3 : 1; // usage 0x00090003: button 3 tertiary, value = 0 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 127 int8_t gd_mousepointerinstance4y; // usage 0x00010031: y, value = -127 127 } inputreport04_t;
Comments
Post a Comment