]> sigrok.org Git - libsigrokdecode.git/blame - decoders/usb_request/__init__.py
edid: Add support for extension blocks, cleanups
[libsigrokdecode.git] / decoders / usb_request / __init__.py
CommitLineData
bd0e7d2e
SB
1##
2## This file is part of the libsigrokdecode project.
3##
4## Copyright (C) 2015 Stefan Brüns <stefan.bruens@rwth-aachen.de>
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License as published by
8## the Free Software Foundation; either version 2 of the License, or
9## (at your option) any later version.
10##
11## This program is distributed in the hope that it will be useful,
12## but WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14## GNU General Public License for more details.
15##
16## You should have received a copy of the GNU General Public License
4539e9ca 17## along with this program; if not, see <http://www.gnu.org/licenses/>.
bd0e7d2e
SB
18##
19
20'''
21This decoder stacks on top of the 'usb_packet' PD and decodes the USB
22(low-speed and full-speed) transactions.
23
24Transactions and requests are tracked per device address and endpoint.
25
26Tracking of CONTROL requests is quite accurate, as these always start with
27a SETUP token and are completed by an IN or OUT transaction, the status
28packet. All transactions during the DATA stage are combined.
29
30For BULK and INTERRUPT requests, each transaction starts with an IN or OUT
31request, and is considered completed after the first transaction containing
32data has been ACKed. Normally a request is only completed after a short or
33zero length packet, but this would require knowledge about the max packet
34size of an endpoint.
35
36All INTERRUPT requests are treated as BULK requests, as on the link layer
37both are identical.
38
39The PCAP binary output contains 'SUBMIT' and 'COMPLETE' records. For
40CONTROL request, the SUBMIT contains the SETUP request, the data is
41either contained in the SUBMIT (Host-to-Device) or the COMPLETE
42(Device-to-Host) record.
43
44Details:
45https://en.wikipedia.org/wiki/USB
46http://www.usb.org/developers/docs/
47'''
48
49from .pd import Decoder