X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fonewire_network%2Fpd.py;h=a9165726205c40e433b65542d442052741b615c1;hb=b413721ccb254e99cf8b8991bb1adf2fb26b53a6;hp=67dfe45ffaa27b17debe49943d4ed6d6d94223bd;hpb=0169f19c53e195df2f96c4df731ad3214c59e20a;p=libsigrokdecode.git diff --git a/decoders/onewire_network/pd.py b/decoders/onewire_network/pd.py index 67dfe45..a916572 100644 --- a/decoders/onewire_network/pd.py +++ b/decoders/onewire_network/pd.py @@ -18,8 +18,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# 1-Wire protocol decoder (network layer) - import sigrokdecode as srd # Dictionary of ROM commands and their names, next state. @@ -43,12 +41,9 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['onewire_link'] outputs = ['onewire_network'] - probes = [] - optional_probes = [] - options = {} - annotations = [ - ['Text', 'Human-readable text'], - ] + annotations = ( + ('text', 'Human-readable text'), + ) def __init__(self, **kwargs): self.beg = 0 @@ -62,7 +57,7 @@ class Decoder(srd.Decoder): self.rom = 0x0000000000000000 def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): @@ -71,7 +66,7 @@ class Decoder(srd.Decoder): def puty(self, data): # Helper function for most protocol packets. - self.put(self.beg, self.end, self.out_proto, data) + self.put(self.beg, self.end, self.out_python, data) def decode(self, ss, es, data): code, val = data @@ -82,7 +77,7 @@ class Decoder(srd.Decoder): self.bit_cnt = 0 self.put(ss, es, self.out_ann, [0, ['Reset/presence: %s' % ('true' if val else 'false')]]) - self.put(ss, es, self.out_proto, ['RESET/PRESENCE', val]) + self.put(ss, es, self.out_python, ['RESET/PRESENCE', val]) self.state = 'COMMAND' return