Skip to content

Commit a1478f3

Browse files
committed
Add feature MY_TRANSPORT_N2N_FEATURE_DISABLED
to disable the node to node transport feature
1 parent f7f177f commit a1478f3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

MyConfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,12 @@
11601160
#define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (20*60*1000ul)
11611161
#endif
11621162

1163+
/**
1164+
*@def MY_TRANSPORT_N2N_FEATURE_DISABLED
1165+
*@brief If defined, disables the node to node transport attempts
1166+
*/
1167+
//#define MY_TRANSPORT_N2N_FEATURE_DISABLED
1168+
11631169
/**
11641170
*@def MY_TRANSPORT_UPLINK_CHECK_DISABLED
11651171
*@brief If defined, disables uplink check to GW during transport initialisation
@@ -2422,6 +2428,7 @@
24222428
// transport
24232429
#define MY_PARENT_NODE_IS_STATIC
24242430
#define MY_REGISTRATION_CONTROLLER
2431+
#define MY_TRANSPORT_N2N_FEATURE_DISABLED
24252432
#define MY_TRANSPORT_UPLINK_CHECK_DISABLED
24262433
#define MY_TRANSPORT_SANITY_CHECK
24272434
#define MY_NODE_LOCK_FEATURE

core/MyTransport.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ bool transportRouteMessage(MyMessage &message)
548548
#else
549549
// not a repeater, all traffic routed via parent or N2N
550550
route = _transportConfig.parentNodeId;
551+
#if !defined(MY_TRANSPORT_N2N_FEATURE_DISABLED)
551552
// Try node2node traffic if destination is not parent and is not a broadcast
552553
if (destination != route && destination != BROADCAST_ADDRESS) {
553554
// N2N: assume node is in vicinity. If transmission fails, hand over to parent
@@ -557,6 +558,7 @@ bool transportRouteMessage(MyMessage &message)
557558
}
558559
TRANSPORT_DEBUG(PSTR("!TSF:RTE:N2N FAIL\n"));
559560
}
561+
#endif
560562
#endif
561563
}
562564
// send message

0 commit comments

Comments
 (0)