From ee1ae627a386eb6113f463f981e7750f21c13088 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Sat, 8 Oct 2022 19:10:50 +0200 Subject: [PATCH] Model the time it is busy receiving/transmitting (#1776) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thomas Göttgens --- src/platform/portduino/SimRadio.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/platform/portduino/SimRadio.cpp b/src/platform/portduino/SimRadio.cpp index ccfaa3b03..b3af114e5 100644 --- a/src/platform/portduino/SimRadio.cpp +++ b/src/platform/portduino/SimRadio.cpp @@ -171,6 +171,8 @@ void SimRadio::onNotify(uint32_t notification) // Packet has been sent, count it toward our TX airtime utilization. uint32_t xmitMsec = getPacketTime(txp); airTime->logAirtime(TX_LOG, xmitMsec); + + delay(xmitMsec); // Model the time it is busy sending completeSending(); } } @@ -207,6 +209,9 @@ void SimRadio::startSend(MeshPacket * txp) void SimRadio::startReceive(MeshPacket *p) { isReceiving = true; + size_t length = getPacketLength(p); + uint32_t xmitMsec = getPacketTime(length); + delay(xmitMsec); // Model the time it is busy receiving handleReceiveInterrupt(p); }