@@ -397,11 +397,11 @@ int MyMesh::calcRxDelay(float score, uint32_t air_time) const {
397397
398398uint32_t MyMesh::getRetransmitDelay (const mesh::Packet *packet) {
399399 uint32_t t = (_radio->getEstAirtimeFor (packet->path_len + packet->payload_len + 2 ) * _prefs.tx_delay_factor );
400- return getRNG ()->nextInt (0 , 5 *t);
400+ return getRNG ()->nextInt (0 , 5 *t + 1 );
401401}
402402uint32_t MyMesh::getDirectRetransmitDelay (const mesh::Packet *packet) {
403403 uint32_t t = (_radio->getEstAirtimeFor (packet->path_len + packet->payload_len + 2 ) * _prefs.direct_tx_delay_factor );
404- return getRNG ()->nextInt (0 , 5 *t);
404+ return getRNG ()->nextInt (0 , 5 *t + 1 );
405405}
406406
407407void 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
610610 _prefs.airtime_factor = 1.0 ; // one half
611611 _prefs.rx_delay_base = 0 .0f ; // turn off by default, was 10.0;
612612 _prefs.tx_delay_factor = 0 .5f ; // was 0.25f
613+ _prefs.direct_tx_delay_factor = 0 .2f ; // was zero
613614 StrHelper::strncpy (_prefs.node_name , ADVERT_NAME, sizeof (_prefs.node_name ));
614615 _prefs.node_lat = ADVERT_LAT;
615616 _prefs.node_lon = ADVERT_LON;
0 commit comments