summaryrefslogtreecommitdiff
path: root/decoders/can
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2015-09-14 18:25:02 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2015-09-14 18:25:02 +0200
commitd4a28d0fb6e1380590564be2b47ba3642130555b (patch)
treedd9059b65b2f22c0ccca778bf172dd3dba741657 /decoders/can
parentc6bfbc0043089e006c684bcce609da50aadded81 (diff)
downloadlibsigrokdecode-d4a28d0fb6e1380590564be2b47ba3642130555b.tar.gz
libsigrokdecode-d4a28d0fb6e1380590564be2b47ba3642130555b.zip
can: Emit bit value annotations.
Diffstat (limited to 'decoders/can')
-rw-r--r--decoders/can/pd.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/decoders/can/pd.py b/decoders/can/pd.py
index df2cbee..7638c2f 100644
--- a/decoders/can/pd.py
+++ b/decoders/can/pd.py
@@ -57,6 +57,11 @@ class Decoder(srd.Decoder):
('ack-delimiter', 'ACK delimiter'),
('stuff-bit', 'Stuff bit'),
('warnings', 'Human-readable warnings'),
+ ('bits', 'Bits'),
+ )
+ annotation_rows = (
+ ('bits', 'Bits', (17,)),
+ ('fields', 'Fields', tuple(range(17))),
)
def __init__(self, **kwargs):
@@ -305,9 +310,8 @@ class Decoder(srd.Decoder):
# Get the index of the current CAN frame bit (without stuff bits).
bitnum = len(self.bits) - 1
- # For debugging.
- # self.putx([0, ['Bit %d (CAN bit %d): %d' % \
- # (self.curbit, bitnum, can_rx)]])
+ # Emit a bit value annotation.
+ self.putx([17, [str(can_rx)]])
# If this is a stuff bit, remove it from self.bits and ignore it.
if self.is_stuff_bit():