Skip to content

Commit 01ab7ba

Browse files
graeme-winterdpgeorge
authored andcommitted
iperf3: Add compatibility for servers pre version 3.2.
Result message from servers pre version 3.2 do not encode start or end time, so workaround this by using the t3, t0 timestamps used elsewhere for sending. Fixes issue micropython#665.
1 parent ce3f282 commit 01ab7ba

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

python-ecosys/iperf3/iperf3.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,14 @@ def stop(self):
147147

148148
def report_receiver(self, stats):
149149
st = stats["streams"][0]
150-
dt = st["end_time"] - st["start_time"]
150+
151+
# iperf servers pre 3.2 do not transmit start or end time,
152+
# so use local as fallback if not available.
153+
dt = ticks_diff(self.t3, self.t0)
154+
151155
self.print_line(
152-
st["start_time"],
153-
st["end_time"],
156+
st.get("start_time", 0.0),
157+
st.get("end_time", dt * 1e-6),
154158
st["bytes"],
155159
st["packets"],
156160
st["errors"],

python-ecosys/iperf3/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
metadata(version="0.1.3", pypi="iperf3", pypi_publish="uiperf3")
1+
metadata(version="0.1.4", pypi="iperf3", pypi_publish="uiperf3")
22

33
module("iperf3.py")

0 commit comments

Comments
 (0)