|
|
|
@ -397,11 +397,11 @@ int MyMesh::calcRxDelay(float score, uint32_t air_time) const { |
|
|
|
|
|
|
|
uint32_t MyMesh::getRetransmitDelay(const mesh::Packet *packet) { |
|
|
|
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.tx_delay_factor); |
|
|
|
return getRNG()->nextInt(0, 5*t); |
|
|
|
return getRNG()->nextInt(0, 5*t + 1); |
|
|
|
} |
|
|
|
uint32_t MyMesh::getDirectRetransmitDelay(const mesh::Packet *packet) { |
|
|
|
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.direct_tx_delay_factor); |
|
|
|
return getRNG()->nextInt(0, 5*t); |
|
|
|
return getRNG()->nextInt(0, 5*t + 1); |
|
|
|
} |
|
|
|
|
|
|
|
void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const mesh::Identity &sender, |
|
|
|
@ -610,6 +610,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc |
|
|
|
_prefs.airtime_factor = 1.0; // one half
|
|
|
|
_prefs.rx_delay_base = 0.0f; // turn off by default, was 10.0;
|
|
|
|
_prefs.tx_delay_factor = 0.5f; // was 0.25f
|
|
|
|
_prefs.direct_tx_delay_factor = 0.2f; // was zero
|
|
|
|
StrHelper::strncpy(_prefs.node_name, ADVERT_NAME, sizeof(_prefs.node_name)); |
|
|
|
_prefs.node_lat = ADVERT_LAT; |
|
|
|
_prefs.node_lon = ADVERT_LON; |
|
|
|
|