]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/xfp/pd.py
Add a CFP decoder.
[libsigrokdecode.git] / decoders / xfp / pd.py
index 26f33116e99092ad8e91b3a82f8663d9dcc71e81..0bc6724511966f8ba43ba8f94076372b40d3209e 100644 (file)
 ##
 
 import sigrokdecode as srd
-from plugtrx import (MODULE_ID, ALARM_THRESHOLDS, AD_READOUTS, GCS_BITS,
+from common.plugtrx import (MODULE_ID, ALARM_THRESHOLDS, AD_READOUTS, GCS_BITS,
         CONNECTOR, TRANSCEIVER, SERIAL_ENCODING, XMIT_TECH, CDR, DEVICE_TECH,
         ENHANCED_OPTS, AUX_TYPES)
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'xfp'
     name = 'XFP'
     longname = '10 Gigabit Small Form Factor Pluggable Module (XFP)'
@@ -37,6 +37,9 @@ class Decoder(srd.Decoder):
     )
 
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         # Received data items, used as an index into samplenum/data
         self.cnt = -1
         # Start/end sample numbers per data item