]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2cdemux/pd.py
Use the new Decoder.register() API
[libsigrokdecode.git] / decoders / i2cdemux / pd.py
index afeaea8082f09b4a48bda2e4ca80f5c2a1512311..d86c59781728fa93c52b4c888ab7c070f5455029 100644 (file)
@@ -42,7 +42,7 @@ class Decoder(srd.Decoder):
         self.stream = -1 # Current output stream
         self.streamcount = 0 # Number of created output streams
 
-    def start(self, metadata):
+    def start(self):
         self.out_proto = []
 
     def report(self):
@@ -68,8 +68,8 @@ class Decoder(srd.Decoder):
 
             # We're never seen this slave, add a new stream.
             self.slaves.append(databyte)
-            self.out_proto.append(self.add(srd.OUTPUT_PROTO,
-                                  'i2c-%s' % hex(databyte)))
+            self.out_proto.append(self.register(srd.OUTPUT_PYTHON,
+                                  proto_id='i2c-%s' % hex(databyte)))
             self.stream = self.streamcount
             self.streamcount += 1
         elif cmd == 'STOP':