mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 01:52:48 +00:00
Rename setRandomDelay() function
This commit is contained in:
parent
692278343b
commit
a13157ebde
@ -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.
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user