Merge pull request #2214 from meshtastic/repeater-role

Skip decoding packets for Repeaters
This commit is contained in:
Ben Meadors 2023-01-28 13:49:12 -06:00 committed by GitHub
commit e05a007fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -48,15 +48,13 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas
traceRouteModule->updateRoute(tosend);
}
LOG_INFO("Rebroadcasting received floodmsg to neighbors", p);
LOG_INFO("Rebroadcasting received floodmsg to neighbors\n");
// Note: we are careful to resend using the original senders node id
// We are careful not to call our hooked version of send() - because we don't want to check this again
Router::send(tosend);
} else {
LOG_DEBUG("Not rebroadcasting. Role = Role_ClientMute\n");
}
} else {
LOG_DEBUG("Ignoring a simple (0 id) broadcast\n");
}

View File

@ -300,8 +300,8 @@ void Router::sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Rout
bool perhapsDecode(meshtastic_MeshPacket *p)
{
// LOG_DEBUG("\n\n** perhapsDecode payloadVariant - %d\n\n", p->which_payloadVariant);
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER)
return false;
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag)
return true; // If packet was already decoded just return
@ -453,7 +453,7 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)
else
printPacket("handleReceived(REMOTE)", p);
} else {
printPacket("packet decoding failed (no PSK?)", p);
printPacket("packet decoding failed or skipped (no PSK?)", p);
}
// call modules here