From: Iztok Jeras Date: Tue, 17 Jul 2012 19:50:08 +0000 (+0200) Subject: onewire: fixed an issue caused by renaming a transport layer command X-Git-Tag: libsigrokdecode-0.1.1~46 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4dfff747ed380c8cda9410b5a7d3d97c59a64a9a;p=libsigrokdecode.git onewire: fixed an issue caused by renaming a transport layer command --- diff --git a/decoders/onewire_transport/onewire_transport.py b/decoders/onewire_transport/onewire_transport.py index 5481bd7..e787091 100644 --- a/decoders/onewire_transport/onewire_transport.py +++ b/decoders/onewire_transport/onewire_transport.py @@ -95,9 +95,11 @@ class Decoder(srd.Decoder): self.state = "UNRECOGNIZED" elif (self.state == "READ SCRATCHPAD"): self.put(ss, es, self.out_ann, [0, ['SCRATCHPAD DATA: 0x%02x' % (val)]]) - elif (self.state == "TEMPERATURE CONVERSION"): + elif (self.state == "CONVERT TEMPERATURE"): self.put(ss, es, self.out_ann, [0, ['TEMPERATURE CONVERSION STATUS: 0x%02x' % (val)]]) + elif (self.state in command.values()): + self.put(ss, es, self.out_ann, [0, ['TODO "%s": 0x%02x' % (self.state, val)]]) elif (self.state == "UNRECOGNIZED"): - self.put(ss, es, self.out_ann, [0, ['UNRECOGNIZED: 0x%02x' % (val)]]) + self.put(ss, es, self.out_ann, [0, ['UNRECOGNIZED COMMAND: 0x%02x' % (val)]]) else: raise Exception('Invalid state: %s' % self.state)