]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2cfilter/pd.py
modbus: Make C->S and S->C configurable, add framegap option.
[libsigrokdecode.git] / decoders / i2cfilter / pd.py
index 3c02a2e40ec46aabc115f4b4ed94ac3fc81e01a6..7798e17ade222826a7c52e5e1fc63e26ecb907f5 100644 (file)
@@ -23,7 +23,7 @@
 import sigrokdecode as srd
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'i2cfilter'
     name = 'I²C filter'
     longname = 'I²C filter'
@@ -31,6 +31,7 @@ class Decoder(srd.Decoder):
     license = 'gplv3+'
     inputs = ['i2c']
     outputs = ['i2c']
+    tags = ['Util']
     options = (
         {'id': 'address', 'desc': 'Address to filter out of the I²C stream',
             'default': 0},
@@ -38,7 +39,10 @@ class Decoder(srd.Decoder):
             'values': ('read', 'write', 'both')}
     )
 
-    def __init__(self, **kwargs):
+    def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.curslave = -1
         self.curdirection = None
         self.packets = [] # Local cache of I²C packets