1usbhid-dump(8) Linux USB Utilities usbhid-dump(8)
2
3
4
6 usbhid-dump - dump USB HID device report descriptors and streams
7
9 usbhid-dump [OPTION]...
10
12 usbhid-dump uses libusb to dump report descriptors and streams from HID
13 (human interface device) interfaces of USB devices. By default, it
14 dumps HID interfaces of all connected USB devices, but could be limited
15 to a subset of them, or to a single interface, using options.
16
17 NOTE: usbhid-dump detaches kernel drivers from the interfaces it dumps
18 and uses them exclusively, so no other program receives the input in
19 the meantime. The report descriptor dumping is instantaneous, but the
20 stream dumping continues until terminated with SIGINT (^C from the ter‐
21 minal) or a timeout expires.
22
23 If you accidentally start dumping a stream from the USB keyboard you
24 use to control the terminal, the system will stop receiving the input
25 and you won't be able to terminate usbhid-dump. Just stop your input
26 and wait until the timeout expires. The stream dumping will stop, the
27 keyboard will be reattached to the kernel driver and you will regain
28 control.
29
30 The default stream dumping timeout is 60 seconds and could be changed
31 with the -t option.
32
34 -h, --help
35 Output a help message and exit.
36
37 -v, --version
38 Output version information and exit.
39
40 -s, -a, --address=bus[:dev]
41 Limit interfaces by bus number and device address. Both 1-255,
42 decimal. Zeroes match any bus or device.
43
44 -d, -m, --model=vid[:pid]
45 Limit interfaces by device vendor and product IDs. Both 1-FFFF,
46 hexadecimal. Zeroes match any vendor or product.
47
48 -i, --interface=NUMBER
49 Limit interfaces by number (0-254), decimal. 255 matches any in‐
50 terface.
51
52 -e, --entity=STRING
53 The entity to dump: either "descriptor", "stream" or "all". The
54 value can be abbreviated down to one letter. The default is "de‐
55 scriptor".
56
57 -t, --stream-timeout=NUMBER
58 Stream interrupt transfer timeout, ms. Zero means infinity. The
59 default is 60000 (60 seconds).
60
61 -p, --stream-paused
62 Start with the stream dump output paused.
63
64 -f, --stream-feedback
65 Enable stream dumping feedback: print a dot to stderr for every
66 transfer dumped.
67
69 USR1/USR2
70 Pause/resume stream dump output.
71
73 usbhid-dump outputs dumps in chunks. Each chunk is separated by an
74 empty line and starts with the following header line:
75
76 BUS:DEVICE:INTERFACE:ENTITY TIMESTAMP
77
78 Here, BUS, DEVICE and INTERFACE are bus, device and interface numbers
79 respectively. ENTITY is either "DESCRIPTOR" or "STREAM". TIMESTAMP is
80 timestamp in seconds since epoch.
81
82 After the header the actual dump data follows as hex bytes. A descrip‐
83 tor chunk includes the whole report descriptor. Every stream chunk in‐
84 cludes a whole report, usually, but if a report is bigger than end‐
85 point's wMaxPacketSize, it will span several chunks.
86
88 Dump report descriptor for a device with address 3 on bus number 2:
89 usbhid-dump -a 2:3
90
91
92 Dump report stream for a device with vendor ID 0x5543 and product ID
93 0x0005:
94 usbhid-dump -m 5543:0005 -es
95
96
97 Dump report descriptor from interface 1 of a device with vendor ID
98 0x5543:
99 usbhid-dump -m 5543 -i 1 -ed
100
101
102 Dump report streams from all HID interfaces of all USB devices (cau‐
103 tion: you will lose control over the terminal if you use USB keyboard):
104 usbhid-dump -es
105
106
108 Nikolai Kondrashov <spbnick@gmail.com>
109
110
111
112usbutils-016 February 2012 usbhid-dump(8)