From a13157ebde2377b0c88300a11e9a3b6c2929f3ca Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sat, 23 Apr 2022 18:57:45 +0200 Subject: [PATCH] Rename setRandomDelay() function --- src/mesh/RadioLibInterface.cpp | 10 +++++----- src/mesh/RadioLibInterface.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index cfadcf644..a0058893a 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -118,10 +118,10 @@ ErrorCode RadioLibInterface::send(MeshPacket *p) return res; } - // set random transmit delay to let others reconfigure their radio, + // set (random) transmit delay to let others reconfigure their radio, // to avoid collisions and implement timing-based flooding // DEBUG_MSG("Set random delay before transmitting.\n"); - setRandomDelay(); + setTransmitDelay(); return res; #else @@ -187,11 +187,11 @@ void RadioLibInterface::onNotify(uint32_t notification) if (!txQueue.empty()) { if (!canSendImmediately()) { // DEBUG_MSG("Currently Rx/Tx-ing: set random delay\n"); - setRandomDelay(); // currently Rx/Tx-ing: reset random delay + setTransmitDelay(); // currently Rx/Tx-ing: reset random delay } else { if (isChannelActive()) { // check if there is currently a LoRa packet on the channel // DEBUG_MSG("Channel is active: set random delay\n"); - setRandomDelay(); // reset random delay + setTransmitDelay(); // reset random delay } else { // Send any outgoing packets we have ready MeshPacket *txp = txQueue.dequeue(); @@ -212,7 +212,7 @@ void RadioLibInterface::onNotify(uint32_t notification) } } -void RadioLibInterface::setRandomDelay() +void RadioLibInterface::setTransmitDelay() { MeshPacket *p = txQueue.getFront(); // We want all sending/receiving to be done by our daemon thread. diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index 2b342a68c..0f59c1fab 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -144,9 +144,9 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified virtual bool cancelSending(NodeNum from, PacketId id) override; private: - /** if we have something waiting to send, start a short random timer so we can come check for collision before actually doing + /** if we have something waiting to send, start a short (random) timer so we can come check for collision before actually doing * the transmit */ - void setRandomDelay(); + void setTransmitDelay(); /** random timer with certain min. and max. settings */ void startTransmitTimer(bool withDelay = true);