Skip to content

Commit 8d4cda1

Browse files
author
Hasnain Virk
committed
Making sure that RX slots open after state change
After transmission we should change the state before invoking opening of slots as we may start receiving in the rx slots and the state would suddenly change from SENDING to RECEIVING without going through the ACK_WAIT state (in case of CONFIRMED messages). Tests show that after this slight adjustment, our number of ack retries have significantly reduced.
1 parent d5ce0cc commit 8d4cda1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

features/lorawan/LoRaWANStack.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ void LoRaWANStack::process_transmission_timeout()
576576
void LoRaWANStack::process_transmission(void)
577577
{
578578
tr_debug("Transmission completed");
579-
_loramac.on_radio_tx_done(_tx_timestamp);
580579

581580
if (_device_current_state == DEVICE_STATE_JOINING) {
582581
_device_current_state = DEVICE_STATE_AWAITING_JOIN_ACCEPT;
@@ -588,6 +587,8 @@ void LoRaWANStack::process_transmission(void)
588587
_device_current_state = DEVICE_STATE_AWAITING_ACK;
589588
}
590589
}
590+
591+
_loramac.on_radio_tx_done(_tx_timestamp);
591592
}
592593

593594
void LoRaWANStack::post_process_tx_with_reception()

0 commit comments

Comments
 (0)