]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/xfp/pd.py
pwm: add period annotation
[libsigrokdecode.git] / decoders / xfp / pd.py
index bc55aa74adbf54218c4855c8cdc0805c5f836559..9a6543c2404ebf08db5d64ec880993dc48b87200 100644 (file)
@@ -18,7 +18,6 @@
 ##
 
 import sigrokdecode as srd
-import os
 
 MODULE_ID = {
     0x01: 'GBIC',
@@ -192,7 +191,7 @@ AUX_TYPES = [
 ]
 
 class Decoder(srd.Decoder):
-    api_version = 1
+    api_version = 2
     id = 'xfp'
     name = 'XFP'
     longname = '10 Gigabit Small Form Factor Pluggable Module (XFP)'
@@ -200,13 +199,10 @@ class Decoder(srd.Decoder):
     license = 'gplv3+'
     inputs = ['i2c']
     outputs = ['xfp']
-    probes = []
-    optional_probes = []
-    options = {}
-    annotations = [
-        ['XFP field names and values', 'XFP structure field names and values'],
-        ['XFP fields', 'XFP structure fields'],
-    ]
+    annotations = (
+        ('fieldnames-and-values', 'XFP structure field names and values'),
+        ('fields', 'XFP structure fields'),
+    )
 
     def __init__(self, **kwargs):
         # Received data items, used as an index into samplenum/data
@@ -648,4 +644,3 @@ class Decoder(srd.Decoder):
         self.annotate("AUX1 monitoring", aux)
         aux = AUX_TYPES[data[0] & 0x0f]
         self.annotate("AUX2 monitoring", aux)
-