Skip to content

Commit

Permalink
riotctrl_shell.gnrc: add parser for reply corruption & truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Feb 2, 2021
1 parent e63927b commit aaf8cba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dist/pythonlibs/riotctrl_shell/gnrc.py
Expand Up @@ -24,7 +24,9 @@ def __init__(self):
r"icmp_seq=(?P<seq>\d+) ttl=(?P<ttl>\d+)"
r"( rssi=(?P<rssi>-?\d+) dBm)?"
r"( time=(?P<rtt>\d+.\d+) ms)?"
r"(?P<dup> \(DUP\))?")
r"(?P<dup> \(DUP\))?"
r"(response truncated by (?P<truncated>\d+) byte"
r"(response corrupt at offset (?P<corrupted>\d+)")
self.c_stats = re.compile(r"(?P<tx>\d+) packets transmitted, "
r"(?P<rx>\d+) packets received, "
r"((?P<dup>\d+) duplicates, )?"
Expand All @@ -48,6 +50,10 @@ def _add_reply(res, reply):
reply["rssi"] = int(reply["rssi"])
else:
reply.pop("rssi", None)
if reply.get("truncated") is not None:
reply["truncated"] = int(reply["truncated"])
if reply.get("corrupted") is not None:
reply["corrupted"] = int(reply["corrupted"])
if "replies" in res:
res["replies"].append(reply)
else:
Expand Down

0 comments on commit aaf8cba

Please sign in to comment.