From 81b6d3aa30b0ce29b3eaf83bc3750859061b34a1 Mon Sep 17 00:00:00 2001 From: tekka007 Date: Mon, 2 Feb 2015 13:50:06 +0100 Subject: [PATCH] Clear routing table extendend I_CHILDREN + "C" clears routing table, parent node and gw distance followed by findParentNode. --- libraries/MySensors/MySensor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/MySensors/MySensor.cpp b/libraries/MySensors/MySensor.cpp index da0f60e..ae918e2 100755 --- a/libraries/MySensors/MySensor.cpp +++ b/libraries/MySensors/MySensor.cpp @@ -365,6 +365,11 @@ boolean MySensor::process() { for (uint8_t i=0;i< sizeof(childNodeTable); i++) { removeChildRoute(i); } + // Clear parent node id & distance to gw + eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, 0xFF); + eeprom_write_byte((uint8_t*)EEPROM_DISTANCE_ADDRESS, 0xFF); + // Find parent node + findParentNode(); sendRoute(build(msg, nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_CHILDREN,false).set("")); } } else if (type == I_TIME) {