Skip to content

Commit 8ae642a

Browse files
committed
Add option to disable N2N (#1439)
to disable the node to node transport feature
1 parent 96856f0 commit 8ae642a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

MyConfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,12 @@
11111111
#define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (20*60*1000ul)
11121112
#endif
11131113

1114+
/**
1115+
*@def MY_TRANSPORT_N2N_FEATURE_DISABLED
1116+
*@brief If defined, disables the direct node to node transport send attempts
1117+
*/
1118+
//#define MY_TRANSPORT_N2N_FEATURE_DISABLED
1119+
11141120
/**
11151121
*@def MY_TRANSPORT_UPLINK_CHECK_DISABLED
11161122
*@brief If defined, disables uplink check to GW during transport initialisation
@@ -2313,6 +2319,7 @@
23132319
// transport
23142320
#define MY_PARENT_NODE_IS_STATIC
23152321
#define MY_REGISTRATION_CONTROLLER
2322+
#define MY_TRANSPORT_N2N_FEATURE_DISABLED
23162323
#define MY_TRANSPORT_UPLINK_CHECK_DISABLED
23172324
#define MY_TRANSPORT_SANITY_CHECK
23182325
#define MY_NODE_LOCK_FEATURE

core/MyTransport.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ bool transportRouteMessage(MyMessage &message)
545545
#endif
546546
}
547547
#else
548+
#if !defined(MY_TRANSPORT_N2N_FEATURE_DISABLED)
548549
if (destination > GATEWAY_ADDRESS && destination < BROADCAST_ADDRESS) {
549550
// node2node traffic: assume node is in vincinity. If transmission fails, hand over to parent
550551
if (transportSendWrite(destination, message)) {
@@ -553,6 +554,7 @@ bool transportRouteMessage(MyMessage &message)
553554
}
554555
TRANSPORT_DEBUG(PSTR("!TSF:RTE:N2N FAIL\n"));
555556
}
557+
#endif
556558
route = _transportConfig.parentNodeId; // not a repeater, all traffic routed via parent
557559
#endif
558560
}

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ MY_TRANSPORT_TIMEOUT_EXT_FAILURE_STATE_MS LITERAL1
7878
MY_TRANSPORT_TIMEOUT_FAILURE_STATE_MS LITERAL1
7979
MY_TRANSPORT_UPLINK_CHECK_DISABLED LITERAL1
8080
MY_TRANSPORT_WAIT_READY_MS LITERAL1
81+
MY_TRANSPORT_N2N_FEATURE_DISABLED LITERAL1
8182

8283
# debug
8384
MY_DEBUG LITERAL1

0 commit comments

Comments
 (0)