fix a possible parent repeater loop

This commit is contained in:
Marcelo Aquino
2015-01-30 18:39:09 -02:00
parent 64dae7405c
commit 6b76eb3df6
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -47,6 +47,7 @@ void MyGateway::begin(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e da
}
nc.nodeId = 0;
nc.parentNodeId = 0;
nc.distance = 0;
inclusionMode = 0;
buttonTriggeredInclusion = false;
+1 -1
View File
@@ -287,7 +287,7 @@ boolean MySensor::process() {
if (repeaterMode && command == C_INTERNAL && type == I_FIND_PARENT) {
if (nc.distance == 255) {
findParentNode();
} else {
} else if (sender != nc.parentNodeId) {
// Relaying nodes should always answer ping messages
// Wait a random delay of 0-2 seconds to minimize collision
// between ping ack messages from other relaying nodes