From 980f57f51d31e7d3788232bdae81c76e2cd0f1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2ESchr=C3=B6der?= Date: Thu, 6 Mar 2025 18:27:09 +0100 Subject: [PATCH] LookUp of Next-Hops now more sophisticated --- src/mesh/MeshService.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index d1b786a44..515c6ce85 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -233,8 +233,14 @@ ErrorCode MeshService::sendQueueStatusToPhone(const meshtastic_QueueStatus &qs, void MeshService::sendToMesh(meshtastic_MeshPacket *p, RxSource src, bool ccToPhone) { - if(config.network.routingAlgorithm == meshtastic_Config_RoutingConfig_FishEyeState && moduleConfig.fish_eye_state_routing.enabled && p->decoded.dest != 0 && p->decoded.dest != NODENUM_BROADCAST){ - p->to = fishEyeStateRoutingModule->getNextHopForID(p->decoded.dest); + if(config.network.routingAlgorithm == meshtastic_Config_RoutingConfig_FishEyeState && moduleConfig.fish_eye_state_routing.enabled){ + if(p->decoded.dest != 0 && p->decoded.dest != NODENUM_BROADCAST){ + p->to = fishEyeStateRoutingModule->getNextHopForID(p->decoded.dest); + }else if ((p->decoded.dest == p->to && p->decoded.dest != 0 && p->decoded.dest != NODENUM_BROADCAST) || (p->decoded.dest == 0 && p->to != 0 && p->to != NODENUM_BROADCAST )) + { + p->decoded.dest = p->to; + p->to = fishEyeStateRoutingModule->getNextHopForID(p->decoded.dest); + } } uint32_t mesh_packet_id = p->id;