summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-05-23 01:12:11 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2012-05-23 01:12:11 +0200
commit1227e5854dcf4f6b5cd2f9792f66ea994c3a7bad (patch)
treed591fba619441cee3f2694f673efae1465cbadb9 /decoders
parent080243a8224c8453c4993ad22f5bdc63e1dba2de (diff)
downloadlibsigrokdecode-1227e5854dcf4f6b5cd2f9792f66ea994c3a7bad.tar.gz
libsigrokdecode-1227e5854dcf4f6b5cd2f9792f66ea994c3a7bad.zip
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.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/onewire/onewire.py6
1 files 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