summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--decoders/cec/pd.py2
-rw-r--r--decoders/cec/protocoldata.py6
2 files changed, 1 insertions, 7 deletions
diff --git a/decoders/cec/pd.py b/decoders/cec/pd.py
index a742f81..4028b7e 100644
--- a/decoders/cec/pd.py
+++ b/decoders/cec/pd.py
@@ -136,7 +136,7 @@ class Decoder(srd.Decoder):
(src, dst) = decode_header(self.cmd_bytes[i]['val'])
str = 'HDR: ' + src + ', ' + dst
elif i == 1: # Parse opcode
- str += ' | OPC: ' + decode_opcode(self.cmd_bytes[i]['val'])
+ str += ' | OPC: ' + opcodes.get(self.cmd_bytes[i]['val'], 'Invalid')
else: # Parse operands
if operands == 0:
str += ' | OPS: '
diff --git a/decoders/cec/protocoldata.py b/decoders/cec/protocoldata.py
index fb80494..833ac7f 100644
--- a/decoders/cec/protocoldata.py
+++ b/decoders/cec/protocoldata.py
@@ -115,9 +115,3 @@ def decode_header(header):
src = (header & 0xF0) >> 4
dst = (header & 0x0F)
return (resolve_logical_address(src, 1), resolve_logical_address(dst, 0))
-
-def decode_opcode(opcode):
- if opcode in opcodes:
- return opcodes[opcode]
- else:
- return 'Invalid'