mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-15 01:35:03 +00:00
Don't alloc NodeInfo replies when channel utilization is > 40% (#3991)
* Don't alloc NodeInfo replies when channel utilization is > 40% * Commit * Logs
This commit is contained in:
parent
af9d825266
commit
0b48663cbc
@ -58,10 +58,15 @@ void NodeInfoModule::sendOurNodeInfo(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
|
|
||||||
meshtastic_MeshPacket *NodeInfoModule::allocReply()
|
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();
|
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 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)) {
|
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
|
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user