]> sigrok.org Git - libsigrokdecode.git/commitdiff
ir_rc5: Convert to PD API version 3.
authorUwe Hermann <redacted>
Fri, 16 Jun 2017 14:23:10 +0000 (16:23 +0200)
committerUwe Hermann <redacted>
Fri, 16 Jun 2017 14:23:10 +0000 (16:23 +0200)
decoders/ir_rc5/pd.py

index adf4e06c56485e67f5c68c1b71b722263b517ecf..0b39e709698f935610fa30d475b35c42b8ee0ff4 100644 (file)
@@ -24,7 +24,7 @@ class SamplerateError(Exception):
     pass
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'ir_rc5'
     name = 'IR RC-5'
     longname = 'IR RC-5'
@@ -134,12 +134,12 @@ class Decoder(srd.Decoder):
         self.edges, self.bits, self.ss_es_bits = [], [], []
         self.state = 'IDLE'
 
-    def decode(self, ss, es, data):
+    def decode(self):
         if not self.samplerate:
             raise SamplerateError('Cannot decode without samplerate.')
-        for (self.samplenum, pins) in data:
+        while True:
 
-            self.ir = pins[0]
+            (self.ir,) = self.wait({'skip': 1})
 
             # Wait for any edge (rising or falling).
             if self.old_ir == self.ir: