Skip to content

Commit efeeb09

Browse files
author
Kimmo Vaisanen
committed
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 2a824a1 commit efeeb09

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
@@ -651,6 +651,7 @@ void LoRaWANStack::process_reception(const uint8_t *const payload, uint16_t size
651651
}
652652

653653
if (!_loramac.nwk_joined()) {
654+
_ready_for_rx = true;
654655
return;
655656
}
656657

@@ -1172,7 +1173,8 @@ void LoRaWANStack::process_joining_state(lorawan_status_t &op_status)
11721173
return;
11731174
}
11741175

1175-
if (_device_current_state == DEVICE_STATE_AWAITING_JOIN_ACCEPT) {
1176+
if (_device_current_state == DEVICE_STATE_AWAITING_JOIN_ACCEPT &&
1177+
_loramac.get_current_slot() != RX_SLOT_WIN_1) {
11761178
_device_current_state = DEVICE_STATE_JOINING;
11771179
// retry join
11781180
bool can_continue = _loramac.continue_joining_process();

0 commit comments

Comments
 (0)