Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions connectivity/lorawan/lorastack/mac/LoRaMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,9 @@ lorawan_status_t LoRaMac::send(loramac_mhdr_t *machdr, const uint8_t fport,
_mcps_confirmation.nb_retries = 0;
_mcps_confirmation.ack_received = false;
_mcps_confirmation.ul_frame_counter = _params.ul_frame_counter;
// Reset per-frame repetition counter so nb_retries in the TX confirmation
// reports the count for this frame only, not cumulative across all frames.
_params.ul_nb_rep_counter = 0;

status = schedule_tx();

Expand Down
8 changes: 6 additions & 2 deletions connectivity/lorawan/source/LoRaWANStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,14 @@ void LoRaWANStack::post_process_tx_no_reception()
} else {
_ctrl_flags |= TX_DONE_FLAG;

uint8_t prev_QOS_level = _loramac.get_prev_QOS_level();
// LoRaWAN spec 4.3.1.1: all NbTrans retransmissions use the same FCnt.
// FCnt is incremented only after all retransmissions are done.
// The _qos_cnt counter (reset to 1 per frame in handle_tx) controls
// the number of physical transmissions independently of any LinkADRReq
// transition, so no prev/current QOS comparison is needed here.
uint8_t QOS_level = _loramac.get_QOS_level();

if (QOS_level > LORAWAN_DEFAULT_QOS && (prev_QOS_level == QOS_level)) {
if (QOS_level > LORAWAN_DEFAULT_QOS) {
if (_qos_cnt < QOS_level) {
const int ret = _queue->call(this, &LoRaWANStack::state_controller,
DEVICE_STATE_SCHEDULING);
Expand Down
Loading