Skip to content

Commit 63084ad

Browse files
authored
Merge pull request #11241 from teijokinnunen/lorawan-uplink-rx-fix
LoRaWAN: Terminate RX when receiving uplink messages
2 parents 0838248 + 10c0f20 commit 63084ad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

features/lorawan/lorastack/mac/LoRaMac.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,15 @@ void LoRaMac::on_radio_rx_done(const uint8_t *const payload, uint16_t size,
738738
break;
739739

740740
default:
741+
// This can happen e.g. if we happen to receive uplink of another device
742+
// during the receive window. Block RX2 window since it can overlap with
743+
// QOS TX and cause a mess.
744+
tr_debug("RX unexpected mtype %u", mac_hdr.bits.mtype);
745+
if (get_current_slot() == RX_SLOT_WIN_1) {
746+
_lora_time.stop(_params.timers.rx_window2_timer);
747+
}
748+
_mcps_indication.status = LORAMAC_EVENT_INFO_STATUS_ADDRESS_FAIL;
749+
_mcps_indication.pending = false;
741750
break;
742751
}
743752
}

0 commit comments

Comments
 (0)