164 lines
4.9 KiB
HTML
164 lines
4.9 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of usbhid-dump</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>usbhid-dump</H1>
|
|
Section: Maintenance Commands (8)<BR>Updated: February 2012<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
usbhid-dump - dump USB HID device report descriptors and streams
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>usbhid-dump</B>
|
|
|
|
[OPTION]...
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>usbhid-dump</B>
|
|
|
|
uses
|
|
<B>libusb</B>
|
|
|
|
to dump report descriptors and streams from HID (human interface device)
|
|
interfaces of USB devices. By default, it dumps HID interfaces of all
|
|
connected USB devices, but could be limited to a subset of them, or to a single
|
|
interface, using options.
|
|
<P>
|
|
NOTE: usbhid-dump detaches kernel drivers from the interfaces it dumps and uses
|
|
them exclusively, so no other program receives the input in the meantime. The
|
|
report descriptor dumping is instantaneous, but the stream dumping continues
|
|
until terminated with SIGINT (^C from the terminal) or a timeout expires.
|
|
<P>
|
|
If you accidentally start dumping a stream from the USB keyboard you use to
|
|
control the terminal, the system will stop receiving the input and you won't
|
|
be able to terminate usbhid-dump. Just stop your input and wait until the
|
|
timeout expires. The stream dumping will stop, the keyboard will be
|
|
reattached to the kernel driver and you will regain control.
|
|
<P>
|
|
The default stream dumping timeout is 60 seconds and could be changed with the
|
|
-t option.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-h, --help</B>
|
|
|
|
<DD>
|
|
Output a help message and exit.
|
|
<DT id="2"><B>-v, --version</B>
|
|
|
|
<DD>
|
|
Output version information and exit.
|
|
<DT id="3"><B>-s, -a, --address=bus[:dev]</B>
|
|
|
|
<DD>
|
|
Limit interfaces by bus number and device address. Both 1-255, decimal.
|
|
Zeroes match any bus or device.
|
|
<DT id="4"><B>-d, -m, --model=vid[:pid]</B>
|
|
|
|
<DD>
|
|
Limit interfaces by device vendor and product IDs. Both 1-FFFF, hexadecimal.
|
|
Zeroes match any vendor or product.
|
|
<DT id="5"><B>-i, --interface=NUMBER</B>
|
|
|
|
<DD>
|
|
Limit interfaces by number (0-254), decimal. 255 matches any interface.
|
|
<DT id="6"><B>-e, --entity=STRING</B>
|
|
|
|
<DD>
|
|
The entity to dump: either "descriptor", "stream" or "all". The value can be
|
|
abbreviated down to one letter. The default is "descriptor".
|
|
<DT id="7"><B>-t, --stream-timeout=NUMBER</B>
|
|
|
|
<DD>
|
|
Stream interrupt transfer timeout, ms. Zero means infinity. The default is
|
|
60000 (60 seconds).
|
|
<DT id="8"><B>-p, --stream-paused</B>
|
|
|
|
<DD>
|
|
Start with the stream dump output paused.
|
|
<DT id="9"><B>-f, --stream-feedback</B>
|
|
|
|
<DD>
|
|
Enable stream dumping feedback: print a dot to stderr for every transfer
|
|
dumped.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SIGNALS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="10"><B>USR1/USR2</B>
|
|
|
|
<DD>
|
|
Pause/resume stream dump output.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>OUTPUT FORMAT</H2>
|
|
|
|
<B>usbhid-dump</B>
|
|
|
|
outputs dumps in chunks. Each chunk is separated by an empty line and starts
|
|
with the following header line:
|
|
<P>
|
|
BUS:DEVICE:INTERFACE:ENTITY TIMESTAMP
|
|
<P>
|
|
Here, BUS, DEVICE and INTERFACE are bus, device and interface numbers
|
|
respectively. ENTITY is either "DESCRIPTOR" or "STREAM". TIMESTAMP is
|
|
timestamp in seconds since epoch.
|
|
<P>
|
|
After the header the actual dump data follows as hex bytes. A descriptor
|
|
chunk includes the whole report descriptor. Every stream chunk includes a
|
|
whole report, usually, but if a report is bigger than endpoint's
|
|
wMaxPacketSize, it will span several chunks.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="11">Dump report descriptor for a device with address 3 on bus number 2:<DD>
|
|
<B>usbhid-dump -a 2:3</B>
|
|
|
|
<P>
|
|
<DT id="12">Dump report stream for a device with vendor ID 0x5543 and product ID 0x0005:<DD>
|
|
<B>usbhid-dump -m 5543:0005 -es</B>
|
|
|
|
<P>
|
|
<DT id="13">Dump report descriptor from interface 1 of a device with vendor ID 0x5543:<DD>
|
|
<B>usbhid-dump -m 5543 -i 1 -ed</B>
|
|
|
|
<P>
|
|
<DT id="14">Dump report streams from all HID interfaces of all USB devices (caution: you will lose control over the terminal if you use USB keyboard):<DD>
|
|
<B>usbhid-dump -es</B>
|
|
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Nikolai Kondrashov <<A HREF="mailto:spbnick@gmail.com">spbnick@gmail.com</A>>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="15"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="16"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="17"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="18"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="19"><A HREF="#lbAF">SIGNALS</A><DD>
|
|
<DT id="20"><A HREF="#lbAG">OUTPUT FORMAT</A><DD>
|
|
<DT id="21"><A HREF="#lbAH">EXAMPLES</A><DD>
|
|
<DT id="22"><A HREF="#lbAI">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:18 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|