Skip to content

Commit 40a3b2f

Browse files
Change N2N if destination is not parent or broadcast (#1478) (#1479)
1 parent 8b51ea7 commit 40a3b2f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/MyTransport.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,17 @@ bool transportRouteMessage(MyMessage &message)
546546
#endif
547547
}
548548
#else
549-
if (destination > GATEWAY_ADDRESS && destination < BROADCAST_ADDRESS) {
550-
// node2node traffic: assume node is in vincinity. If transmission fails, hand over to parent
549+
// not a repeater, all traffic routed via parent or N2N
550+
route = _transportConfig.parentNodeId;
551+
// Try node2node traffic if destination is not parent and is not a broadcast
552+
if (destination != route && destination != BROADCAST_ADDRESS) {
553+
// N2N: assume node is in vicinity. If transmission fails, hand over to parent
551554
if (transportSendWrite(destination, message)) {
552555
TRANSPORT_DEBUG(PSTR("TSF:RTE:N2N OK\n"));
553556
return true;
554557
}
555558
TRANSPORT_DEBUG(PSTR("!TSF:RTE:N2N FAIL\n"));
556559
}
557-
route = _transportConfig.parentNodeId; // not a repeater, all traffic routed via parent
558560
#endif
559561
}
560562
// send message

0 commit comments

Comments
 (0)