From: Uwe Hermann Date: Tue, 22 May 2012 23:12:11 +0000 (+0200) Subject: srd: onewire: Fix incorrect format for annotation output. X-Git-Tag: libsigrokdecode-0.1.1~104 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=1227e5854dcf4f6b5cd2f9792f66ea994c3a7bad;hp=080243a8224c8453c4993ad22f5bdc63e1dba2de 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. --- 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