diff --git a/Logparser/logparser.js b/Logparser/logparser.js index 05ac8f1cc..8835476d8 100644 --- a/Logparser/logparser.js +++ b/Logparser/logparser.js @@ -322,6 +322,7 @@ var match = [ { re: "!TSF:RTE:FPAR ACTIVE", d: "Finding parent active, message not sent" }, { re: "!TSF:RTE:(\\d+) UNKNOWN", d: "Routing for destination $1 unknown, sending message to parent" }, { re: "!TSF:RTE:N2N FAIL", d: "Direct node-to-node communication failed - handing over to parent" }, + { re: "TSF:RTE:N2N DIS", d: "Direct node-to-node communication disabled by configuration" }, { re: "TSF:RRT:ROUTE N=(\\d+),R=(\\d+)", d: "Routing table, messages to node ($1) are routed via node ($2)"}, { re: "!TSF:SND:TNR", d: "Transport not ready, message cannot be sent" }, { re: "TSF:TDI:TSL", d: "Set transport to sleep" }, diff --git a/MyConfig.h b/MyConfig.h index 0aa451420..822e02cc3 100755 --- a/MyConfig.h +++ b/MyConfig.h @@ -1111,6 +1111,15 @@ #define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (20*60*1000ul) #endif +/** + *@def MY_TRANSPORT_N2N_FEATURE_DISABLED + *@brief If defined, disables the direct node to node transport send attempts + * + * Use this function together with the option @ref MY_PARENT_NODE_IS_STATIC + * to ensure that all telegrams sent are routed exclusively through the associated parent node. + */ +//#define MY_TRANSPORT_N2N_FEATURE_DISABLED + /** *@def MY_TRANSPORT_UPLINK_CHECK_DISABLED *@brief If defined, disables uplink check to GW during transport initialisation @@ -2313,6 +2322,7 @@ // transport #define MY_PARENT_NODE_IS_STATIC #define MY_REGISTRATION_CONTROLLER +#define MY_TRANSPORT_N2N_FEATURE_DISABLED #define MY_TRANSPORT_UPLINK_CHECK_DISABLED #define MY_TRANSPORT_SANITY_CHECK #define MY_NODE_LOCK_FEATURE diff --git a/core/MyTransport.cpp b/core/MyTransport.cpp index 4c91da55f..561fe730e 100644 --- a/core/MyTransport.cpp +++ b/core/MyTransport.cpp @@ -545,6 +545,7 @@ bool transportRouteMessage(MyMessage &message) #endif } #else +#if !defined(MY_TRANSPORT_N2N_FEATURE_DISABLED) if (destination > GATEWAY_ADDRESS && destination < BROADCAST_ADDRESS) { // node2node traffic: assume node is in vincinity. If transmission fails, hand over to parent if (transportSendWrite(destination, message)) { @@ -553,6 +554,9 @@ bool transportRouteMessage(MyMessage &message) } TRANSPORT_DEBUG(PSTR("!TSF:RTE:N2N FAIL\n")); } +#else + TRANSPORT_DEBUG(PSTR("TSF:RTE:N2N DIS\n")); +#endif route = _transportConfig.parentNodeId; // not a repeater, all traffic routed via parent #endif } diff --git a/core/MyTransport.h b/core/MyTransport.h index ef1451cad..210c8c482 100644 --- a/core/MyTransport.h +++ b/core/MyTransport.h @@ -119,6 +119,7 @@ * |!| TSF | RTE | FPAR ACTIVE | Finding parent active, message not sent * |!| TSF | RTE | DST %%d UNKNOWN | Routing for destination (DST) unknown, send message to parent * | | TSF | RTE | N2N OK | Node-to-node communication succeeded +* | | TSF | RTE | N2N DIS | Node-to-node communication disabled by configuration * |!| TSF | RTE | N2N FAIL | Node-to-node communication failed, handing over to parent for re-routing * | | TSF | RRT | ROUTE N=%%d,R=%%d | Routing table, messages to node (N) are routed via node (R) * |!| TSF | SND | TNR | Transport not ready, message cannot be sent diff --git a/keywords.txt b/keywords.txt index d63941799..4048df728 100755 --- a/keywords.txt +++ b/keywords.txt @@ -78,6 +78,7 @@ MY_TRANSPORT_TIMEOUT_EXT_FAILURE_STATE_MS LITERAL1 MY_TRANSPORT_TIMEOUT_FAILURE_STATE_MS LITERAL1 MY_TRANSPORT_UPLINK_CHECK_DISABLED LITERAL1 MY_TRANSPORT_WAIT_READY_MS LITERAL1 +MY_TRANSPORT_N2N_FEATURE_DISABLED LITERAL1 # debug MY_DEBUG LITERAL1