]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/onewire_network/pd.py
tests/check_session.c: Fix compiler warning.
[libsigrokdecode.git] / decoders / onewire_network / pd.py
index a80132e2a23a41d5151c097ce9e2c185a0999d4e..5c836c2db845b545750c3336bc3467ebcaabfa6d 100644 (file)
@@ -33,7 +33,7 @@ command = {
 }
 
 class Decoder(srd.Decoder):
-    api_version = 1
+    api_version = 2
     id = 'onewire_network'
     name = '1-Wire network layer'
     longname = '1-Wire serial communication bus (network layer)'
@@ -41,12 +41,9 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['onewire_link']
     outputs = ['onewire_network']
-    probes = []
-    optional_probes = []
-    options = {}
-    annotations = [
-        ['text', 'Human-readable text'],
-    ]
+    annotations = (
+        ('text', 'Human-readable text'),
+    )
 
     def __init__(self, **kwargs):
         self.beg = 0
@@ -129,8 +126,6 @@ class Decoder(srd.Decoder):
             if self.onewire_collect(8, val, ss, es) == 0:
                 return
             self.putx([0, ['ROM error data: 0x%02x' % self.data]])
-        else:
-            raise Exception('Invalid state: %s' % self.state)
 
     # Data collector.
     def onewire_collect(self, length, val, ss, es):