From 1227e5854dcf4f6b5cd2f9792f66ea994c3a7bad Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 23 May 2012 01:12:11 +0200 Subject: [PATCH] srd: onewire: Fix incorrect format for annotation output. Should be a list containing: - Annotation format number (e.g. 0, or ANN_DEC, etc). - A list of strings (the annotation). If more than one string is supplied, the other ones should be short versions of the string. Example: [ANN_DEC, ["Foobarbaz", "Foo", "F"]] This is optional, and mostly useful for GUIs. --- decoders/onewire/onewire.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/decoders/onewire/onewire.py b/decoders/onewire/onewire.py index 7fb1325..38cc0b8 100644 --- a/decoders/onewire/onewire.py +++ b/decoders/onewire/onewire.py @@ -149,8 +149,10 @@ class Decoder(srd.Decoder): self.net_cnt = self.net_cnt + 1 self.net_cmd = (self.net_cmd << 1) & self.lnk_bit if (self.lnk_cnt == 8): - self.put(self.startsample, self.samplenum, self.out_proto, ['LNK: BYTE', self.lnk_byte]) - self.put(self.startsample, self.samplenum, self.out_ann , ['LNK: BYTE', self.lnk_byte]) + self.put(self.startsample, self.samplenum, + self.out_proto, ['LNK: BYTE', self.lnk_byte]) + self.put(self.startsample, self.samplenum, self.out_ann, + [ANN_DEC, ['LNK: BYTE: ' + self.lnk_byte]]) if (self.net_cmd == 0x33): # READ ROM break -- 2.30.2