From df7bc07259e8c16b5fad35a5e606d19c155726cf Mon Sep 17 00:00:00 2001 From: smathis Date: Fri, 17 Jan 2025 10:47:58 +0100 Subject: [PATCH] Fixed two small bugs in the analyzeTcpDump utility --- utils/analyzeTcpDump/analyzeTcpDump.py | 11 ++++++----- utils/analyzeTcpDump/demo.py | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/utils/analyzeTcpDump/analyzeTcpDump.py b/utils/analyzeTcpDump/analyzeTcpDump.py index 701bbd0..66ee7a7 100755 --- a/utils/analyzeTcpDump/analyzeTcpDump.py +++ b/utils/analyzeTcpDump/analyzeTcpDump.py @@ -79,7 +79,7 @@ def parse(fileAndPath): value = int(response) lastLayer = lastPacket.getlayer(Raw) - lastTime = int(lastPacket.time) + lastTime = float(lastPacket.time) data = { 'command': { 'hex': [format(value, '02x') for value in lastLayer.load], @@ -180,10 +180,11 @@ After a successfull parse run, the resulting JSON data looks like this: (e.g. Q0100= to set the position of axis 1) - - - + Command + + + """) diff --git a/utils/analyzeTcpDump/demo.py b/utils/analyzeTcpDump/demo.py index fabe07b..2d1183d 100755 --- a/utils/analyzeTcpDump/demo.py +++ b/utils/analyzeTcpDump/demo.py @@ -70,8 +70,8 @@ if __name__ == "__main__": position_target.append(position_target[-1]) plt.plot(dates_target, position_target, "k--", label="Target position") - plt.plot(dates_all, position_all, "r", label="All responses") - plt.plot(dates_valid, position_valid, "b", label="Valid responses") + plt.plot(dates_all, position_all, "r-", label="All responses") + plt.plot(dates_valid, position_valid, "b-", label="Valid responses") plt.xlabel("Time (ISO 8601)") plt.ylabel("Axis position in degree") plt.gca().xaxis.set_major_formatter(mdates.DateFormatter("%Y-%m-%dT%H:%M:%S"))