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 66df92a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dist/pythonlibs/riotctrl_shell/gnrc.py
Expand Up @@ -25,10 +25,12 @@ def __init__(self):
r"( rssi=(?P<rssi>-?\d+) dBm)?"
r"( time=(?P<rtt>\d+.\d+) ms)?"
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, )?"
r"(?P<packet_loss>\d+)% packet loss")
r"(?P<packet_loss>\d+)% packet loss"
self.c_rtts = re.compile(r"round-trip min/avg/max = (?P<min>\d+.\d+)/"
r"(?P<avg>\d+.\d+)/(?P<max>\d+.\d+) ms")

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 66df92a

Please sign in to comment.