我正在尝试解码连接到Linux计算机时从/ dev / hidraw2中读取的多点触摸屏的HID RAW数据流。
我已经有多点触摸屏的HID报告描述符和来自屏幕的64字节流。 1 finger touch 到目前为止,我可以理解02-报告ID / 04-07如果被按下或未按下/ xx-我不知道// xx xx坐标// yy yy坐标。但这必须是一种方法,它可以读取隐藏的描述符,并将其转换为我正在获取的数据流。
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Touchscreen), ; Touch screen (04h, application collection)
Collection (Application),
Report ID (2),
Usage (Finger), ; Finger (22h, logical collection)
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Collection (Logical),
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (Tip Switch), ; Tip switch (42h, momentary control)
Logical Minimum (0),
Logical Maximum (1),
Report Size (1),
Report Count (1),
Input (Variable),
Usage (In Range), ; In range (32h, momentary control)
Input (Variable),
Usage (47h),
Input (Variable),
Report Count (5),
Input (Constant, Variable),
Report Size (8),
Usage (51h),
Report Count (1),
Input (Variable),
Usage Page (Desktop), ; Generic desktop controls (01h)
Logical Minimum (0),
Logical Maximum (32767),
Report Size (16),
Usage (X), ; X (30h, dynamic value)
Input (Variable),
Usage (Y), ; Y (31h, dynamic value)
Input (Variable),
End Collection,
Usage Page (Digitizer), ; Digitizer (0Dh)
Usage (54h),
Report Count (1),
Report Size (8),
Input (Variable),
Usage (55h),
Logical Maximum (10),
Feature (Variable),
End Collection,
Usage (0Eh),
Collection (Application),
Report ID (4),
Usage (23h),
Collection (Logical),
Usage (52h),
Logical Minimum (0),
Logical Maximum (10),
Report Size (8),
Report Count (1),
Feature (Variable),
End Collection,
End Collection,
Usage Page (FF00h), ; FF00h, vendor-defined
Usage (01h),
Collection (Application),
Report ID (250),
Usage (01h),
Usage Minimum (01h),
Usage Maximum (3Fh),
Logical Minimum (0),
Logical Maximum (-1),
Report Size (8),
Report Count (63),
Input (Variable),
Report ID (18),
Usage (02h),
Usage Minimum (01h),
Usage Maximum (3Fh),
Output (Variable),
Report ID (16),
Usage (03h),
Usage Minimum (01h),
Usage Maximum (3Fh),
Logical Minimum (0),
Logical Maximum (-1),
Report Size (8),
Report Count (7),
Feature (Variable),
End Collection
答案 0 :(得分:0)
输入报告02解码为以下C语言结构(请参见下文)。基本上,它包括一个1字节的报告ID,10个手指触摸数据(标志,联系人ID,x,y)和一个1字节的联系人计数(即检测到的触摸次数)。输入报告的总长度应为1 + 10x(1 + 1 + 2 + 2)+1 = 62字节:
//--------------------------------------------------------------------------------
// Digitizer Device Page inputReport 02 (Device --> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x02 (2)
// Collection: CA:TouchScreen CL:Finger
uint8_t DIG_TouchScreenFingerTipSwitch : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_1 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_1 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_1 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_1; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_1; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_1; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_2 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_2 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_2 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_2; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_2; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_2; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_3 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_3 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_3 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_3; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_3; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_3; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_4 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_4 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_4 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_4; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_4; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_4; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_5 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_5 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_5 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_5; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_5; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_5; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_6 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_6 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_6 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_6; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_6; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_6; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_7 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_7 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_7 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_7; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_7; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_7; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_8 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_8 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_8 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_8; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_8; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_8; // Usage 0x00010031: Y, Value = 0 to 32767
uint8_t DIG_TouchScreenFingerTipSwitch_9 : 1; // Usage 0x000D0042: Tip Switch, Value = 0 to 1
uint8_t DIG_TouchScreenFingerInRange_9 : 1; // Usage 0x000D0032: In Range, Value = 0 to 1
uint8_t DIG_TouchScreenFingerConfidence_9 : 1; // Usage 0x000D0047: Confidence, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t DIG_TouchScreenFingerContactIdentifier_9; // Usage 0x000D0051: Contact Identifier, Value = 0 to 1
uint16_t GD_TouchScreenFingerX_9; // Usage 0x00010030: X, Value = 0 to 32767
uint16_t GD_TouchScreenFingerY_9; // Usage 0x00010031: Y, Value = 0 to 32767
// Collection: CA:TouchScreen
uint8_t DIG_TouchScreenContactCount; // Usage 0x000D0054: Contact Count, Value = 0 to 10
} inputReport02_t;