Merge pull request from meshtastic/prefer-repeaters-too

Weight tx delay to prefer Repeaters as well
This commit is contained in:
Ben Meadors 2023-01-30 11:55:43 -06:00 committed by GitHub
commit 5c22901ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,7 +227,8 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr)
uint8_t CWsize = map(snr, SNR_MIN, SNR_MAX, CWmin, CWmax);
// LOG_DEBUG("rx_snr of %f so setting CWsize to:%d\n", snr, CWsize);
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT) {
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT ||
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
delay = random(0, 2 * CWsize) * slotTimeMsec;
LOG_DEBUG("rx_snr found in packet. As a router, setting tx delay:%d\n", delay);
} else {