summaryrefslogtreecommitdiff
path: root/decoders/ds2432
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-10-19 09:36:17 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-10-19 11:41:17 +0200
commit3a9f6abf26e98198986567d83c790ad11fd1f875 (patch)
tree831d6a96f8067bf917e93e7e764f308397564893 /decoders/ds2432
parent444960cc19c62edab0b259c06b03fa096f9d5a72 (diff)
downloadlibsigrokdecode-3a9f6abf26e98198986567d83c790ad11fd1f875.tar.gz
libsigrokdecode-3a9f6abf26e98198986567d83c790ad11fd1f875.zip
ds2432: Simplify MAC printing.
Diffstat (limited to 'decoders/ds2432')
-rw-r--r--decoders/ds2432/pd.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/decoders/ds2432/pd.py b/decoders/ds2432/pd.py
index 269a23e..d50a6d8 100644
--- a/decoders/ds2432/pd.py
+++ b/decoders/ds2432/pd.py
@@ -177,13 +177,9 @@ class Decoder(srd.Decoder):
self.ss = ss
elif 24 == len(self.bytes):
self.es = es
- self.putx([0, ['Message authentication code: '
- + (','.join(format(n, '#04x')
- for n in self.bytes[4:24])),
- 'MAC: '
- + (','.join(format(n, '#04x')
- for n in self.bytes[4:24])),
- ]])
+ mac = ','.join(format(n, '#04x') for n in self.bytes[4:24])
+ self.putx([0, ['Message authentication code: ' + mac,
+ 'MAC: ' + mac]])
elif 24 < len(self.bytes):
self.ss, self.es = ss, es
if (0xaa == self.bytes[-1] or 0x55 == self.bytes[-1]):
@@ -218,13 +214,9 @@ class Decoder(srd.Decoder):
self.ss = ss
elif 58 == len(self.bytes):
self.es = es
- self.putx([0, ['Message authentication code: '
- + (','.join(format(n, '#04x')
- for n in self.bytes[38:58])),
- 'MAC: '
- + (','.join(format(n, '#04x')
- for n in self.bytes[38:58])),
- ]])
+ mac = ','.join(format(n, '#04x') for n in self.bytes[38:58])
+ self.putx([0, ['Message authentication code: ' + mac,
+ 'MAC: ' + mac]])
elif 59 == len(self.bytes):
self.ss = ss
elif 60 == len(self.bytes):