Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lorawan: Fix issue in unconfirmed_retransmission behavior #15225

Merged
Merged
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
29 changes: 6 additions & 23 deletions connectivity/lorawan/source/LoRaWANStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,29 +619,12 @@ void LoRaWANStack::post_process_tx_with_reception()
}
}
} else {
// handle UNCONFIRMED case here, RX slots were turned off due to
// valid packet reception.
uint8_t prev_QOS_level = _loramac.get_prev_QOS_level();
uint8_t QOS_level = _loramac.get_QOS_level();

// We will not apply QOS on the post-processing of the previous
// outgoing message as we would have received QOS instruction in response
// to that particular message
if (QOS_level > LORAWAN_DEFAULT_QOS && _qos_cnt < QOS_level
&& (prev_QOS_level == QOS_level)) {
_ctrl_flags &= ~TX_DONE_FLAG;
const int ret = _queue->call(this, &LoRaWANStack::state_controller,
DEVICE_STATE_SCHEDULING);
MBED_ASSERT(ret != 0);
(void) ret;
_qos_cnt++;
tr_info("QOS: repeated transmission #%d queued", _qos_cnt);
} else {
_loramac.post_process_mcps_req();
_ctrl_flags |= TX_DONE_FLAG;
make_tx_metadata_available();
state_controller(DEVICE_STATE_STATUS_CHECK);
}
// On reception, end-device shall stop sending retransmission as stated in lorawan v1.0.2
// specification, page 24, line 25-27
_loramac.post_process_mcps_req();
_ctrl_flags |= TX_DONE_FLAG;
make_tx_metadata_available();
state_controller(DEVICE_STATE_STATUS_CHECK);
}
}

Expand Down
2 changes: 1 addition & 1 deletion connectivity/lorawan/system/lorawan_data_structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ typedef struct {
*
* Provides a certain QOS level set by network server in LinkADRReq MAC
* command. The device will transmit the given UNCONFIRMED message nb_trials
* time with same frame counter until a downlink is received. Standard defined
* time with the same frame counter OR until a downlink is received. Standard defined
* range is 1:15. Data rates will NOT be adapted according to chapter 18.4.
*/
uint8_t nb_trials;
Expand Down