kopia lustrzana https://github.com/meshtastic/firmware
Don't alloc NodeInfo replies when channel utilization is > 40% (#3991)
* Don't alloc NodeInfo replies when channel utilization is > 40% * Commit * Logspull/3985/head^2
rodzic
af9d825266
commit
0b48663cbc
|
@ -58,10 +58,15 @@ void NodeInfoModule::sendOurNodeInfo(NodeNum dest, bool wantReplies, uint8_t cha
|
|||
|
||||
meshtastic_MeshPacket *NodeInfoModule::allocReply()
|
||||
{
|
||||
if (!airTime->isTxAllowedChannelUtil(false)) {
|
||||
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||
LOG_DEBUG("Skip sending NodeInfo due to > 40 percent channel util.\n");
|
||||
return NULL;
|
||||
}
|
||||
uint32_t now = millis();
|
||||
// If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway.
|
||||
if (lastSentToMesh && (now - lastSentToMesh) < (5 * 60 * 1000)) {
|
||||
LOG_DEBUG("Sending NodeInfo will be ignored since we just sent it.\n");
|
||||
LOG_DEBUG("Skip sending NodeInfo since we just sent it less than 5 minutes ago.\n");
|
||||
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||
return NULL;
|
||||
} else {
|
||||
|
|
Ładowanie…
Reference in New Issue