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:4bType=3:2bSize=1:00x06
0xFF0x45000001100000 0110
0xFF45 -> 0xFF00 -0xFFFF = Vendor definedUsage PageGlobal item2 bytes 

2

[Data][Data]bTag=7:4bType=3:2bSize=1:00x0A
0xA00x00000010100000 1010
Usage=0xA000UsageLocal item2 bytes 

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

3

 [Data]bTag=7:4bType=3:2bSize=1:00xA1
 0x01101000011010 0001
 Application (mouse, keyboard)CollectionMain item1 bytes 

4

 [Data]bTag=7:4bType=3:2bSize=1:00x75
 0x08011101010111 0101
 Report Size = 0x08 bitsReport SizeGlobal item1 bytes 

5

[Data][Data]bTag=7:4bType=3:2bSize=1:00x96
0x010x07100101101001 0110
Report Count = 0x0107=263Report CountGlobal item2 bytes 

6

 [Data]bTag=7:4bType=3:2bSize=1:00x15
 0x00000101010001 0101
 Logical Minimum = 0x00Logical MinimumGlobal item1 bytes 

7

[Data][Data]bTag=7:4bType=3:2bSize=1:00x26
0x000xFF001001100010 0110
Logical Maximum =x00FF=255Logical MaximumGlobal item2 bytes 

8

[Data][Data]bTag=7:4bType=3:2bSize=1:00x0A
0xA00x01000010100000 1010
Usage = 0xA001UsageLocal item2 bytes 

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

9

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

0x02=0000 0010

Bit 1 { Variable (1)}

All other bits are Reserved (0)

OutputMain item1 bytes 

10

 [Data]bTag=7:4bType=3:2bSize=1:00x75
 0x08011101010111 0101
 Report Size = 0x08 bitsReport SizeGlobal item1 bytes 

11

 [Data]bTag=7:4bType=3:2bSize=1:00x95
 0x08100101011001 0101
 Report Count= 0x08 = 8Report CountGlobal item1 bytes 

12

[Data][Data]bTag=7:4bType=3:2bSize=1:00x0A
0xA00x02000010100000 1010
Usage = 0xA002UsageLocal item2 bytes 

13

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

0x02=0000 0010

Bit 1 { Variable (1)}

All other bits are Reserved (0)

InputMain item1 bytes 

14

 [Data]bTag=7:4bType=3:2bSize=1:00xC0
  110000001100 0000
Closes an item collectionEnd CollectionMain item0 bytes 

After analyze following data, the summary is:

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

Report (Usage=0xA0000) 
 Output Report (Usage=0xA001)
263 bytesByte 0
 Byte 1
 ...
 ...
 Byte 261
 Byte 262
  
 Input Report (Usage=0xA002)
8 bytesByte 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