Fix direct retry review nits

This commit is contained in:
mikecarper committed 2026-06-17 16:44:58 -07:00
1 parent 19cfc43269
commit 6b8135aa36
4 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -953,7 +953,7 @@ region save
---
### Direct Retry
Direct retry resends direct-routed packets when the downstream echo is not heard. It applies to direct messages and TRACE packets. It does not change ACK handling.
Direct retry resends direct-routed packets when the downstream echo is not heard. It applies to direct messages, ACK packets, multipart packets carrying ACK payloads, and TRACE packets.
#### View or change direct retry state
**Usage:**
+1 -1
View File
@@ -574,8 +574,8 @@ uint8_t MyMesh::getDirectRetryCodingRateForSNR(int8_t snr_x4) const {
if (!_prefs.direct_retry_cr_enabled) return 0;
if (snr_x4 >= _prefs.direct_retry_cr4_snr_x4) return 4;
if (snr_x4 >= _prefs.direct_retry_cr5_snr_x4) return 5;
if (snr_x4 >= _prefs.direct_retry_cr7_snr_x4) return 7;
if (snr_x4 <= _prefs.direct_retry_cr8_snr_x4) return 8;
if (snr_x4 >= _prefs.direct_retry_cr7_snr_x4) return 7;
return 7;
}
+5 -1
View File
@@ -348,19 +348,23 @@ void Dispatcher::checkSend() {
outbound_restore_cr = 0;
outbound_restore_preamble_len = 0;
uint8_t default_cr = getDefaultTxCodingRate();
bool using_low_retry_cr = false;
if (outbound->tx_cr >= 4 && outbound->tx_cr <= 8 && default_cr >= 4 && default_cr <= 8
&& outbound->tx_cr != default_cr) {
if (_radio->setCodingRate(outbound->tx_cr)) {
outbound_restore_cr = default_cr;
using_low_retry_cr = outbound->tx_cr == 4 || outbound->tx_cr == 5;
max_airtime = _radio->getEstAirtimeFor(len)*3/2;
} else {
MESH_DEBUG_PRINTLN("%s Dispatcher::checkSend(): WARN: failed to set packet CR%d", getLogDateTime(), (uint32_t)outbound->tx_cr);
}
} else if (outbound->tx_cr == 4 || outbound->tx_cr == 5) {
using_low_retry_cr = outbound->tx_cr == default_cr;
}
bool has_direct_path = outbound->getPathHashCount() > 0
|| (outbound->getPayloadType() == PAYLOAD_TYPE_TRACE && outbound->payload_len > 9);
if (outbound->isRouteDirect() && has_direct_path
&& (outbound->tx_cr == 4 || outbound->tx_cr == 5)) {
&& using_low_retry_cr) {
uint16_t default_preamble_len = _radio->getDefaultPreambleLength();
if (default_preamble_len > 16 && _radio->setPreambleLength(16)) {
outbound_restore_preamble_len = default_preamble_len;
-1
View File
@@ -87,4 +87,3 @@ bool Packet::readFrom(const uint8_t src[], uint8_t len) {
}
}