X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fusb_packet%2Fpd.py;h=489e58eb81419b10b548de0d12865413acfc5ad4;hb=d0d63deadf5b841199c42721bc498fc5c9a86126;hp=8d1de65bc33460a5605e77036a492134047a23c3;hpb=be0f8fee99fe939c50ed5d2483a924754788c0b3;p=libsigrokdecode.git diff --git a/decoders/usb_packet/pd.py b/decoders/usb_packet/pd.py index 8d1de65..489e58e 100644 --- a/decoders/usb_packet/pd.py +++ b/decoders/usb_packet/pd.py @@ -15,8 +15,7 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## import sigrokdecode as srd @@ -174,7 +173,7 @@ def calc_crc16(bitstr): return reverse_number(crc16, 16) class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'usb_packet' name = 'USB packet' longname = 'Universal Serial Bus (LS/FS) packet' @@ -223,6 +222,9 @@ class Decoder(srd.Decoder): ) def __init__(self): + self.reset() + + def reset(self): self.bits = [] self.packet = [] self.packet_summary = '' @@ -358,7 +360,7 @@ class Decoder(srd.Decoder): elif pidname in ('ACK', 'NAK', 'STALL', 'NYET', 'ERR'): pass # Nothing to do, these only have SYNC+PID+EOP fields. elif pidname in ('PRE'): - pass # Nothing to do, PRE only has SYNC+PID fields. + pass # Nothing to do, PRE only has SYNC+PID fields. else: pass # TODO: Handle 'SPLIT' and possibly 'Reserved' packets.