* experimental: retransmit delay, removing the 6 'slots'
This commit is contained in:
@@ -397,11 +397,11 @@ int MyMesh::calcRxDelay(float score, uint32_t air_time) const {
|
|||||||
|
|
||||||
uint32_t MyMesh::getRetransmitDelay(const mesh::Packet *packet) {
|
uint32_t MyMesh::getRetransmitDelay(const mesh::Packet *packet) {
|
||||||
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.tx_delay_factor);
|
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.tx_delay_factor);
|
||||||
return getRNG()->nextInt(0, 6) * t;
|
return getRNG()->nextInt(0, 5*t);
|
||||||
}
|
}
|
||||||
uint32_t MyMesh::getDirectRetransmitDelay(const mesh::Packet *packet) {
|
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);
|
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.direct_tx_delay_factor);
|
||||||
return getRNG()->nextInt(0, 6) * t;
|
return getRNG()->nextInt(0, 5*t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const mesh::Identity &sender,
|
void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const mesh::Identity &sender,
|
||||||
|
|||||||
@@ -262,11 +262,11 @@ const char *MyMesh::getLogDateTime() {
|
|||||||
|
|
||||||
uint32_t MyMesh::getRetransmitDelay(const mesh::Packet *packet) {
|
uint32_t MyMesh::getRetransmitDelay(const mesh::Packet *packet) {
|
||||||
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.tx_delay_factor);
|
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.tx_delay_factor);
|
||||||
return getRNG()->nextInt(0, 6) * t;
|
return getRNG()->nextInt(0, 5*t);
|
||||||
}
|
}
|
||||||
uint32_t MyMesh::getDirectRetransmitDelay(const mesh::Packet *packet) {
|
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);
|
uint32_t t = (_radio->getEstAirtimeFor(packet->path_len + packet->payload_len + 2) * _prefs.direct_tx_delay_factor);
|
||||||
return getRNG()->nextInt(0, 6) * t;
|
return getRNG()->nextInt(0, 5*t);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MyMesh::allowPacketForward(const mesh::Packet *packet) {
|
bool MyMesh::allowPacketForward(const mesh::Packet *packet) {
|
||||||
|
|||||||
Reference in New Issue
Block a user