Skip to content

Commit 81b6d3a

Browse files
committed
Clear routing table extendend
I_CHILDREN + "C" clears routing table, parent node and gw distance followed by findParentNode.
1 parent 7fb9454 commit 81b6d3a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/MySensors/MySensor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ boolean MySensor::process() {
365365
for (uint8_t i=0;i< sizeof(childNodeTable); i++) {
366366
removeChildRoute(i);
367367
}
368+
// Clear parent node id & distance to gw
369+
eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, 0xFF);
370+
eeprom_write_byte((uint8_t*)EEPROM_DISTANCE_ADDRESS, 0xFF);
371+
// Find parent node
372+
findParentNode();
368373
sendRoute(build(msg, nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_CHILDREN,false).set(""));
369374
}
370375
} else if (type == I_TIME) {

0 commit comments

Comments
 (0)