add node to routing table before send an ack

This commit is contained in:
Marcelo Aquino
2015-02-11 10:49:05 -02:00
parent 7b99a2ef94
commit 652d589fe3
+7 -6
View File
@@ -282,6 +282,13 @@ boolean MySensor::process() {
uint8_t destination = msg.destination;
if (destination == nc.nodeId) {
// This message is addressed to this node
if (repeaterMode && last != nc.parentNodeId) {
// Message is from one of the child nodes. Add it to routing table.
addChildRoute(sender, last);
}
// Check if sender requests an ack back.
if (mGetRequestAck(msg)) {
// Copy message
@@ -293,12 +300,6 @@ boolean MySensor::process() {
sendRoute(ack);
}
// This message is addressed to this node
if (repeaterMode && last != nc.parentNodeId) {
// Message is from one of the child nodes. Add it to routing table.
addChildRoute(sender, last);
}
if (command == C_INTERNAL) {
if (type == I_FIND_PARENT_RESPONSE && !isGateway) {
// We've received a reply to a FIND_PARENT message. Check if the distance is