]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: onewire: Fix incorrect format for annotation output.
authorUwe Hermann <redacted>
Tue, 22 May 2012 23:12:11 +0000 (01:12 +0200)
committerUwe Hermann <redacted>
Tue, 22 May 2012 23:12:11 +0000 (01:12 +0200)
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

index 7fb132573c77de6c799ff0f1601455ca49263b67..38cc0b86bef59fc613c06228e44451d4c360e85f 100644 (file)
@@ -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