X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fxfp%2Fpd.py;h=41aca0dbb4ed3f67d4de5b7d28cd295925bc176d;hp=cb67c2d1987556c6c47378149aadae76e4b5ca61;hb=868fd207a7506ae2ab48d6a8755350e452d60521;hpb=5e5002be5bb69ed47317cf70053bf5da2598044d diff --git a/decoders/xfp/pd.py b/decoders/xfp/pd.py index cb67c2d..41aca0d 100644 --- a/decoders/xfp/pd.py +++ b/decoders/xfp/pd.py @@ -191,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)' @@ -199,13 +199,10 @@ class Decoder(srd.Decoder): license = 'gplv3+' inputs = ['i2c'] outputs = ['xfp'] - probes = [] - optional_probes = [] - options = {} - annotations = [ - ['fieldnames-and-values', 'XFP structure field names and values'], - ['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 @@ -321,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) @@ -647,4 +644,3 @@ class Decoder(srd.Decoder): self.annotate("AUX1 monitoring", aux) aux = AUX_TYPES[data[0] & 0x0f] self.annotate("AUX2 monitoring", aux) -