X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fxfp%2Fpd.py;h=41aca0dbb4ed3f67d4de5b7d28cd295925bc176d;hb=46fe9a4ab1327b03809fe3e5e288773f3f93e5ea;hp=623052382ee30b80561d05deb721367b080591cf;hpb=be465111b552c7c2a2262ac49758a30a8bf1b1d5;p=libsigrokdecode.git diff --git a/decoders/xfp/pd.py b/decoders/xfp/pd.py index 6230523..41aca0d 100644 --- a/decoders/xfp/pd.py +++ b/decoders/xfp/pd.py @@ -17,10 +17,7 @@ ## along with this program; if not, see . ## -# XFP protocol decoder - import sigrokdecode as srd -import os MODULE_ID = { 0x01: 'GBIC', @@ -194,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)' @@ -202,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 @@ -324,7 +318,7 @@ class Decoder(srd.Decoder): self.annotate("Vendor ID", chr(data[i]), cnt, cnt) # Convert 16-bit two's complement values, with each increment - # representing 1/256C, to degrees Celcius. + # representing 1/256C, to degrees Celsius. def to_temp(self, value): if value & 0x8000: value = -((value ^ 0xffff) + 1) @@ -650,4 +644,3 @@ class Decoder(srd.Decoder): self.annotate("AUX1 monitoring", aux) aux = AUX_TYPES[data[0] & 0x0f] self.annotate("AUX2 monitoring", aux) -