Pass meshtastic_MeshPacket down into startTransmitTimerRebroadcast and getTxDelayMsecWeighted

This commit is contained in:
Mike Robbins
2025-09-05 13:53:59 -07:00
parent 7e00054fd7
commit 3cc2b70e4f
6 changed files with 11 additions and 11 deletions

View File

@@ -43,7 +43,7 @@ void SimRadio::setTransmitDelay()
} else {
// If there is a SNR, start a timer scaled based on that SNR.
LOG_DEBUG("rx_snr found. hop_limit:%d rx_snr:%f", p->hop_limit, p->rx_snr);
startTransmitTimerRebroadcast(p->rx_snr);
startTransmitTimerRebroadcast(p->rx_snr, p);
}
}
@@ -57,11 +57,11 @@ void SimRadio::startTransmitTimer(bool withDelay)
}
}
void SimRadio::startTransmitTimerRebroadcast(float snr)
void SimRadio::startTransmitTimerRebroadcast(float snr, meshtastic_MeshPacket *p)
{
// If we have work to do and the timer wasn't already scheduled, schedule it now
if (!txQueue.empty()) {
uint32_t delayMsec = getTxDelayMsecWeighted(snr);
uint32_t delayMsec = getTxDelayMsecWeighted(snr, p);
// LOG_DEBUG("xmit timer %d", delay);
notifyLater(delayMsec, TRANSMIT_DELAY_COMPLETED, false);
}

View File

@@ -64,7 +64,7 @@ class SimRadio : public RadioInterface, protected concurrency::NotifiedWorkerThr
void startTransmitTimer(bool withDelay = true);
/** timer scaled to SNR of to be flooded packet */
void startTransmitTimerRebroadcast(float snr);
void startTransmitTimerRebroadcast(float snr, meshtastic_MeshPacket *p);
void handleTransmitInterrupt();
void handleReceiveInterrupt();