@@ -603,17 +603,14 @@ void LoRaWANStack::process_transmission(void)
603
603
_ctrl_flags &= ~TX_DONE_FLAG;
604
604
tr_debug (" Awaiting ACK" );
605
605
_device_current_state = DEVICE_STATE_AWAITING_ACK;
606
- return ;
607
- }
608
-
609
- // Class A unconfirmed message sent, TX_DONE event will be sent to
610
- // application when RX2 windows is elapsed, i.e., in process_reception_timeout()
611
- _ctrl_flags &= ~TX_ONGOING_FLAG;
612
- _ctrl_flags |= TX_DONE_FLAG;
613
-
614
- // In Class C, reception timeout never happens, so we handle the state
615
- // progression for TX_DONE in UNCONFIRMED case here
616
- if (_loramac.get_device_class () == CLASS_C) {
606
+ } else if (_loramac.get_device_class () == CLASS_A) {
607
+ // Class A unconfirmed message sent, TX_DONE event will be sent to
608
+ // application when RX2 windows is elapsed, i.e., in process_reception_timeout()
609
+ _ctrl_flags &= ~TX_ONGOING_FLAG;
610
+ _ctrl_flags |= TX_DONE_FLAG;
611
+ } else if (_loramac.get_device_class () == CLASS_C) {
612
+ // In Class C, reception timeout never happens, so we handle the state
613
+ // progression for TX_DONE in UNCONFIRMED case here
617
614
_loramac.post_process_mcps_req ();
618
615
state_controller (DEVICE_STATE_STATUS_CHECK);
619
616
state_machine_run_to_completion ();
@@ -669,9 +666,10 @@ void LoRaWANStack::process_reception(const uint8_t *const payload, uint16_t size
669
666
state_controller (DEVICE_STATE_STATUS_CHECK);
670
667
}
671
668
}
672
- } else {
669
+ } else if (_loramac. get_device_class () == CLASS_A) {
673
670
// handle UNCONFIRMED case here, RX slots were turned off due to
674
- // valid packet reception
671
+ // valid packet reception. For Class C, an outgoing UNCONFIRMED message
672
+ // gets its handling in process_transmission.
675
673
_loramac.post_process_mcps_req ();
676
674
_ctrl_flags |= TX_DONE_FLAG;
677
675
state_controller (DEVICE_STATE_STATUS_CHECK);
0 commit comments