Merge pull request #59 from mapnull/hotfix-rt_before_ack
add node to routing table before send an ack
This commit is contained in:
@@ -282,6 +282,13 @@ boolean MySensor::process() {
|
|||||||
uint8_t destination = msg.destination;
|
uint8_t destination = msg.destination;
|
||||||
|
|
||||||
if (destination == nc.nodeId) {
|
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.
|
// Check if sender requests an ack back.
|
||||||
if (mGetRequestAck(msg)) {
|
if (mGetRequestAck(msg)) {
|
||||||
// Copy message
|
// Copy message
|
||||||
@@ -293,12 +300,6 @@ boolean MySensor::process() {
|
|||||||
sendRoute(ack);
|
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 (command == C_INTERNAL) {
|
||||||
if (type == I_FIND_PARENT_RESPONSE && !isGateway) {
|
if (type == I_FIND_PARENT_RESPONSE && !isGateway) {
|
||||||
// We've received a reply to a FIND_PARENT message. Check if the distance is
|
// We've received a reply to a FIND_PARENT message. Check if the distance is
|
||||||
|
|||||||
Reference in New Issue
Block a user