Skip to content

Commit 6ce5e1a

Browse files
Kimmo VaisanenCruz Monrreal II
authored andcommitted
Lora: Fix join-response failure handling
Thix commit fixes a bug where stack was resending join-accept already after RX1 if received join-response was invalid. Stack should wait for RX2 before resending the join-accept.
1 parent 838a69d commit 6ce5e1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

features/lorawan/LoRaWANStack.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ void LoRaWANStack::process_reception(const uint8_t *const payload, uint16_t size
654654
}
655655

656656
if (!_loramac.nwk_joined()) {
657+
_ready_for_rx = true;
657658
return;
658659
}
659660

@@ -1164,7 +1165,8 @@ void LoRaWANStack::process_joining_state(lorawan_status_t &op_status)
11641165
return;
11651166
}
11661167

1167-
if (_device_current_state == DEVICE_STATE_AWAITING_JOIN_ACCEPT) {
1168+
if (_device_current_state == DEVICE_STATE_AWAITING_JOIN_ACCEPT &&
1169+
_loramac.get_current_slot() != RX_SLOT_WIN_1) {
11681170
_device_current_state = DEVICE_STATE_JOINING;
11691171
// retry join
11701172
bool can_continue = _loramac.continue_joining_process();

0 commit comments

Comments
 (0)