Skip to content

Commit f4077af

Browse files
author
Hasnain Virk
committed
UL FCnt increment in case of retry exhaustion
Previously we had been incrementing UL frame counter for a CONFIRMED message only when the transmission was deemed successful i.e., we would have received an ack before all the retries would have exhausted. Now we have opted to increment the frame counter if all the retries are exhausted considering the fact that we essentially treat the next message after retry exhaustion as a new packet so we should also increment the frame counter.
1 parent 9d28c3f commit f4077af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

features/lorawan/LoRaWANStack.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,8 @@ void LoRaWANStack::post_process_tx_with_reception()
614614
_loramac.get_device_class() == CLASS_A ? "A" : "C");
615615
_ctrl_flags &= ~TX_DONE_FLAG;
616616
_ctrl_flags |= RETRY_EXHAUSTED_FLAG;
617+
_loramac.post_process_mcps_req();
618+
make_tx_metadata_available();
617619
state_controller(DEVICE_STATE_STATUS_CHECK);
618620
}
619621
}

features/lorawan/lorastack/mac/LoRaMac.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,12 @@ void LoRaMac::post_process_mcps_req()
166166
_params.is_node_ack_requested = false;
167167
_mcps_confirmation.ack_received = false;
168168
_mcps_indication.is_ack_recvd = false;
169-
_params.ul_frame_counter++;
170-
_params.adr_ack_counter++;
171169
} else {
172170
_mcps_confirmation.status = LORAMAC_EVENT_INFO_STATUS_ERROR;
173171
}
172+
173+
_params.ul_frame_counter++;
174+
_params.adr_ack_counter++;
174175
} else {
175176
//UNCONFIRMED or PROPRIETARY
176177
_params.ul_frame_counter++;

0 commit comments

Comments
 (0)