X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fonewire_network%2Fpd.py;h=a80132e2a23a41d5151c097ce9e2c185a0999d4e;hb=a74855de187198624fefd2c12ef8355e5a869f80;hp=6db95ec4547001145e1903bffcd902fd11b3f372;hpb=8915b34659332288aab38780d8f10d75c4c83e7f;p=libsigrokdecode.git diff --git a/decoders/onewire_network/pd.py b/decoders/onewire_network/pd.py index 6db95ec..a80132e 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. @@ -47,7 +45,7 @@ class Decoder(srd.Decoder): optional_probes = [] options = {} annotations = [ - ['Text', 'Human-readable text'], + ['text', 'Human-readable text'], ] def __init__(self, **kwargs): @@ -62,11 +60,8 @@ class Decoder(srd.Decoder): self.rom = 0x0000000000000000 def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'onewire_network') - self.out_ann = self.add(srd.OUTPUT_ANN, 'onewire_network') - - def report(self): - pass + self.out_python = self.register(srd.OUTPUT_PYTHON) + self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): # Helper function for most annotations. @@ -74,7 +69,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 @@ -85,7 +80,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