aboutsummaryrefslogtreecommitdiff
path: root/decode/qmux.py
diff options
context:
space:
mode:
Diffstat (limited to 'decode/qmux.py')
-rw-r--r--decode/qmux.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/decode/qmux.py b/decode/qmux.py
index 4ff5cad7..b26d5345 100644
--- a/decode/qmux.py
+++ b/decode/qmux.py
@@ -60,7 +60,11 @@ class Tlv:
def show(self, prefix):
svc = services[self.service]
- cmd = svc[1][self.cmdno]
+ cmd = [ None, None, None ]
+ try:
+ cmd = svc[1][self.cmdno]
+ except KeyError:
+ pass
tlvlist = None
if self.direction == TP_REQUEST:
tlvlist = cmd[1]
@@ -69,7 +73,7 @@ class Tlv:
elif self.direction == TP_INDICATION:
tlvlist = cmd[3]
else:
- raise ValueError("Unknown TLV dir0ection %s" % self.direction)
+ raise ValueError("Unknown TLV direction %s" % self.direction)
tlvname = "!!! UNKNOWN !!!"
if self.service == 1 and self.cmdno == 77: # WDS/SET_IP_FAMILY
@@ -79,6 +83,8 @@ class Tlv:
tlvname = tlvlist[self.id]
except KeyError:
pass
+ except TypeError:
+ pass
print prefix + " TLV: 0x%02x (%s)" % (self.id, tlvname)
print prefix + " Size: 0x%04x" % self.size
@@ -173,7 +179,11 @@ def show(data, prefix, direction):
print prefix + " TXN: 0x%04x" % txnid
- scmd = qmi_cmd_to_string(cmdno, service)
+ scmd = "!!! UNKNOWN !!!"
+ try:
+ scmd = qmi_cmd_to_string(cmdno, service)
+ except KeyError:
+ pass
print prefix + " Cmd: 0x%04x (%s)" % (cmdno, scmd)
print prefix + " Size: 0x%04x" % size