14
14
#endif /* __cplusplus */
16
16
#include <sys/types.h>
20
* -------------------------------------------------------------------------- */
22
typedef unsigned char uchar;
26
typedef unsigned long ulong;
33
20
* -------------------------------------------------------------------------- */
34
#define PATH_SIZE 10 /* Deep max for Path */
35
#define USAGE_TAB_SIZE 50 /* Size of usage stack */
36
#define MAX_REPORT 300 /* Including FEATURE, INPUT and OUTPUT */
37
#define REPORT_DSC_SIZE 6144 /* Size max of Report Descriptor */
21
#define PATH_SIZE 10 /* Deep max for Path */
22
#define USAGE_TAB_SIZE 50 /* Size of usage stack */
23
#define MAX_REPORT 300 /* Including FEATURE, INPUT and OUTPUT */
24
#define REPORT_DSC_SIZE 6144 /* Size max of Report Descriptor */
25
#define MAX_REPORT_TS 3 /* Max time validity of a report */
41
29
* -------------------------------------------------------------------------- */
46
#define SIZE_MASK 0x03
34
#define SIZE_MASK 0x03
48
#define TYPE_MAIN 0x00
49
#define TYPE_GLOBAL 0x04
50
#define TYPE_LOCAL 0x08
51
#define TYPE_MASK 0xC0
36
#define TYPE_MAIN 0x00
37
#define TYPE_GLOBAL 0x04
38
#define TYPE_LOCAL 0x08
39
#define TYPE_MASK 0xC0
54
#define ITEM_COLLECTION 0xA0
55
#define ITEM_END_COLLECTION 0xC0
56
#define ITEM_FEATURE 0xB0
57
#define ITEM_INPUT 0x80
58
#define ITEM_OUTPUT 0x90
42
#define ITEM_COLLECTION 0xA0
43
#define ITEM_END_COLLECTION 0xC0
44
#define ITEM_FEATURE 0xB0
45
#define ITEM_INPUT 0x80
46
#define ITEM_OUTPUT 0x90
61
#define ITEM_UPAGE 0x04
62
#define ITEM_LOG_MIN 0x14
63
#define ITEM_LOG_MAX 0x24
64
#define ITEM_PHY_MIN 0x34
65
#define ITEM_PHY_MAX 0x44
66
#define ITEM_UNIT_EXP 0x54
67
#define ITEM_UNIT 0x64
68
#define ITEM_REP_SIZE 0x74
69
#define ITEM_REP_ID 0x84
70
#define ITEM_REP_COUNT 0x94
49
#define ITEM_UPAGE 0x04
50
#define ITEM_LOG_MIN 0x14
51
#define ITEM_LOG_MAX 0x24
52
#define ITEM_PHY_MIN 0x34
53
#define ITEM_PHY_MAX 0x44
54
#define ITEM_UNIT_EXP 0x54
55
#define ITEM_UNIT 0x64
56
#define ITEM_REP_SIZE 0x74
57
#define ITEM_REP_ID 0x84
58
#define ITEM_REP_COUNT 0x94
73
#define ITEM_USAGE 0x08
74
#define ITEM_STRING 0x78
61
#define ITEM_USAGE 0x08
62
#define ITEM_STRING 0x78
76
#define ITEM_MASK 0xFC
64
#define ITEM_MASK 0xFC
78
66
/* Attribut Flags */
79
#define ATTR_DATA_CST 0x01
80
#define ATTR_NVOL_VOL 0x80
67
#define ATTR_DATA_CST 0x01
68
#define ATTR_NVOL_VOL 0x80
97
85
* -------------------------------------------------------------------------- */
100
uchar Size; /* HID Path size */
101
HIDNode Node[PATH_SIZE]; /* HID Path */
88
u_char Size; /* HID Path size */
89
HIDNode Node[PATH_SIZE]; /* HID Path */
108
96
* -------------------------------------------------------------------------- */
111
long Value; /* HID Object Value */
112
HIDPath Path; /* HID Path */
99
long Value; /* HID Object Value */
100
HIDPath Path; /* HID Path */
114
uchar ReportID; /* Report ID */
115
uchar Offset; /* Offset of data in report */
116
uchar Size; /* Size of data in bit */
118
uchar Type; /* Type : FEATURE / INPUT / OUTPUT */
119
uchar Attribute; /* Report field attribute */
121
long Unit; /* HID Unit */
122
char UnitExp; /* Unit exponent */
102
u_char ReportID; /* Report ID */
103
u_char Offset; /* Offset of data in report */
104
u_char Size; /* Size of data in bit */
106
u_char Type; /* Type : FEATURE / INPUT / OUTPUT */
107
u_char Attribute; /* Report field attribute */
109
long Unit; /* HID Unit */
110
char UnitExp; /* Unit exponent*/
124
long LogMin; /* Logical Min */
125
long LogMax; /* Logical Max */
126
long PhyMin; /* Physical Min */
127
long PhyMax; /* Physical Max */
112
long LogMin; /* Logical Min */
113
long LogMax; /* Logical Max */
114
long PhyMin; /* Physical Min */
115
long PhyMax; /* Physical Max */
132
120
* -------------------------------------------------------------------------- */
135
uchar ReportDesc[REPORT_DSC_SIZE]; /* Store Report Descriptor */
136
ushort ReportDescSize; /* Size of Report Descriptor */
137
ushort Pos; /* Store current pos in descriptor */
138
uchar Item; /* Store current Item */
139
long Value; /* Store current Value */
141
HIDData Data; /* Store current environment */
143
uchar OffsetTab[MAX_REPORT][3]; /* Store ID, Type & offset of report */
144
uchar ReportCount; /* Store Report Count */
145
uchar Count; /* Store local report count */
147
ushort UPage; /* Global UPage */
148
HIDNode UsageTab[USAGE_TAB_SIZE]; /* Usage stack */
149
uchar UsageSize; /* Design number of usage used */
151
uchar nObject; /* Count Objects in Report Descriptor */
152
uchar nReport; /* Count Reports in Report Descriptor */
123
u_char ReportDesc[REPORT_DSC_SIZE]; /* Store Report Descriptor */
124
u_short ReportDescSize; /* Size of Report Descriptor */
125
u_short Pos; /* Store current pos in descriptor */
126
u_char Item; /* Store current Item */
127
long Value; /* Store current Value */
129
HIDData Data; /* Store current environment */
131
u_char OffsetTab[MAX_REPORT][4]; /* Store ID, Type, offset & timestamp of report */
132
u_char ReportCount; /* Store Report Count */
133
u_char Count; /* Store local report count */
135
u_short UPage; /* Global UPage */
136
HIDNode UsageTab[USAGE_TAB_SIZE]; /* Usage stack */
137
u_char UsageSize; /* Design number of usage used */
139
u_char nObject; /* Count Objects in Report Descriptor */
140
u_char nReport; /* Count Reports in Report Descriptor */
155
143
#ifdef __cplusplus