Fixed issue in unconfirmed_retransmission behavior

Fixed issue on LoRaWANStack based on lorawan v1.0.2 specification page
24 line 25-27. The specification mentioned that that end-device shall
stop retransmission when receiving ANY downlink on RX1 or RX2 window.

- Removed conflicting behavior in
  LoRaWANStack::post_process_tx_with_reception()
- Updated comment section of nb_trials at lorawan_data_structures.h
pull/15225/head
Zulkarnaen 2022-02-11 14:54:31 +01:00 committed by zul
parent c6d814e68c
commit 1e9254387e
2 changed files with 7 additions and 24 deletions

View File

@ -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);
}
}

View File

@ -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;