2.2. An HID Report Example analysis

Follow is the example.

According to the format, defined in specification:

图 2.4. HID Data Format

HID Data Format

Now to analysis the corresponding meaning for every group bytes:

[注意] Data send by LSB

The data is send by LSB, so when “0x45, 0xFF’ is sent, first send is “0x45”, second send “0xFF”, the LSB is “0x45” located in low address, the MSB “0xFF” located in high address, so the hex value is ”0xFF45

	0x06, 0x45, 0xFF,1
	0x0A, 0x00, 0xA0,2
	0xA1, 0x01,3
	0x75, 0x08,4
	0x96, 0x07, 0x01,5
	0x15, 0x00,6
	0x26, 0xFF, 0x00,7
	0x0A, 0x01, 0xA0,8
	0x91, 0x02,9
	0x75, 0x08,10
	0x95, 0x08,11
	0x0A, 0x02, 0xA0,12
	0x81, 0x02,13
	0xC014
        

1

[Data] [Data] bTag=7:4 bType=3:2 bSize=1:0 0x06
0xFF 0x45 0000 01 10 0000 0110
0xFF45 -> 0xFF00 -0xFFFF = Vendor defined Usage Page Global item 2 bytes  

2

[Data] [Data] bTag=7:4 bType=3:2 bSize=1:0 0x0A
0xA0 0x00 0000 10 10 0000 1010
Usage=0xA000 Usage Local item 2 bytes  

here Usage=0xA000 is just self defined, just need not confict with self's others, no other special meaning

3

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0xA1
  0x01 1010 00 01 1010 0001
  Application (mouse, keyboard) Collection Main item 1 bytes  

4

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0x75
  0x08 0111 01 01 0111 0101
  Report Size = 0x08 bits Report Size Global item 1 bytes  

5

[Data] [Data] bTag=7:4 bType=3:2 bSize=1:0 0x96
0x01 0x07 1001 01 10 1001 0110
Report Count = 0x0107=263 Report Count Global item 2 bytes  

6

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0x15
  0x00 0001 01 01 0001 0101
  Logical Minimum = 0x00 Logical Minimum Global item 1 bytes  

7

[Data] [Data] bTag=7:4 bType=3:2 bSize=1:0 0x26
0x00 0xFF 0010 01 10 0010 0110
Logical Maximum =x00FF=255 Logical Maximum Global item 2 bytes  

8

[Data] [Data] bTag=7:4 bType=3:2 bSize=1:0 0x0A
0xA0 0x01 0000 10 10 0000 1010
Usage = 0xA001 Usage Local item 2 bytes  

here Usage=0xA001 is just self defined, just need not confict with self's others, no other special meaning

9

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0x91
  0x02 1001 00 01 1001 0001
 

0x02=0000 0010

Bit 1 { Variable (1)}

All other bits are Reserved (0)

Output Main item 1 bytes  

10

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0x75
  0x08 0111 01 01 0111 0101
  Report Size = 0x08 bits Report Size Global item 1 bytes  

11

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0x95
  0x08 1001 01 01 1001 0101
  Report Count= 0x08 = 8 Report Count Global item 1 bytes  

12

[Data] [Data] bTag=7:4 bType=3:2 bSize=1:0 0x0A
0xA0 0x02 0000 10 10 0000 1010
Usage = 0xA002 Usage Local item 2 bytes  

13

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0x81
  0x02 1000 00 01 1000 0001
 

0x02=0000 0010

Bit 1 { Variable (1)}

All other bits are Reserved (0)

Input Main item 1 bytes  

14

  [Data] bTag=7:4 bType=3:2 bSize=1:0 0xC0
    1100 00 00 1100 0000
Closes an item collection End Collection Main item 0 bytes  

After analyze following data, the summary is:

Usage Page (0xFF45) =Vendor-Specific 0xFF45 06 Global
Usage (0xA000)   0xA000 0A Local
Collection (Application)   0x01 A1 Main
  Report Size (8) 0x08 75 Global
  Report Count (263) 0x0107 96 Global
  Logical Minimum (0) 0x00 15 Global
  Logical Maximum (255) 0x00FF 26 Global
  Usage (0xA001) 0xA0001 0A Local
  Output (Variable) 0x02 91 Main
  Report Size (8) 0x08 75 Global
  Report Count (8) 0x08 95 Global
  Usage (0xA002) 0xA002 0A Local
  Input (Variable) 0x02 81 Main
End Collection   0xC0 Main

Report (Usage=0xA0000)  
  Output Report (Usage=0xA001)
263 bytes Byte 0
  Byte 1
  ...
  ...
  Byte 261
  Byte 262
   
  Input Report (Usage=0xA002)
8 bytes Byte 0
  Byte 1
  ...
  Byte 7
   

All of above means:

  1. This is a vendor-specific HID device
  2. input or output is relative to Host side:
    • Output = Host ⇒ Device = host send 263 bytes to device
    • Input = Host ⇐ Device = device send 8 bytes to host
  3. Every bytes value range is 0~255