Skip to content

Commit 5d0fa3b

Browse files
committed
Merge pull request arduino#59 from mapnull/hotfix-rt_before_ack
add node to routing table before send an ack
2 parents 7b99a2e + 652d589 commit 5d0fa3b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

libraries/MySensors/MySensor.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ boolean MySensor::process() {
282282
uint8_t destination = msg.destination;
283283

284284
if (destination == nc.nodeId) {
285+
// This message is addressed to this node
286+
287+
if (repeaterMode && last != nc.parentNodeId) {
288+
// Message is from one of the child nodes. Add it to routing table.
289+
addChildRoute(sender, last);
290+
}
291+
285292
// Check if sender requests an ack back.
286293
if (mGetRequestAck(msg)) {
287294
// Copy message
@@ -293,12 +300,6 @@ boolean MySensor::process() {
293300
sendRoute(ack);
294301
}
295302

296-
// This message is addressed to this node
297-
if (repeaterMode && last != nc.parentNodeId) {
298-
// Message is from one of the child nodes. Add it to routing table.
299-
addChildRoute(sender, last);
300-
}
301-
302303
if (command == C_INTERNAL) {
303304
if (type == I_FIND_PARENT_RESPONSE && !isGateway) {
304305
// We've received a reply to a FIND_PARENT message. Check if the distance is

0 commit comments

Comments
 (0)