mirror of https://github.com/ARMmbed/mbed-os.git
Bug fix in RX timeout and RX error handling for class c nodes.
1. Do not stop the 2nd window timer, as it is not running. 2. Wait for the OnAckTimeout event, before setting MacDone 3. Process for class c also the 2nd window timeout part, as we do not have a 2nd window timer.pull/6411/head
parent
591bc7da1f
commit
a9e1076572
|
@ -733,12 +733,17 @@ void LoRaMac::on_radio_rx_error( void )
|
||||||
|
|
||||||
mlme.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
|
mlme.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
|
||||||
|
|
||||||
if (_lora_time.get_elapsed_time(_params.timers.aggregated_last_tx_time) >= _params.rx_window2_delay) {
|
if (_params.dev_class != CLASS_C) {
|
||||||
_lora_time.stop(_params.timers.rx_window2_timer);
|
if (_lora_time.get_elapsed_time(_params.timers.aggregated_last_tx_time) >= _params.rx_window2_delay) {
|
||||||
_params.flags.bits.mac_done = 1;
|
_lora_time.stop(_params.timers.rx_window2_timer);
|
||||||
|
_params.flags.bits.mac_done = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
if ((rx_slot == RX_SLOT_WIN_2) || (_params.dev_class == CLASS_C)) {
|
||||||
|
// We need to process this case if the MAC is in class A or B for the 2nd RX window timeout.
|
||||||
|
// If the MAC is in class C, we need to process this part also for the 1st RX window timeout,
|
||||||
|
// as the 2nd window timer is not running.
|
||||||
|
|
||||||
if (_params.is_node_ack_requested == true) {
|
if (_params.is_node_ack_requested == true) {
|
||||||
mcps.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX2_ERROR;
|
mcps.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX2_ERROR;
|
||||||
|
@ -768,12 +773,18 @@ void LoRaMac::on_radio_rx_timeout(void)
|
||||||
}
|
}
|
||||||
mlme.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT;
|
mlme.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT;
|
||||||
|
|
||||||
if (_lora_time.get_elapsed_time(_params.timers.aggregated_last_tx_time ) >= _params.rx_window2_delay) {
|
if (_params.dev_class != CLASS_C) {
|
||||||
_lora_time.stop(_params.timers.rx_window2_timer);
|
if (_lora_time.get_elapsed_time(_params.timers.aggregated_last_tx_time ) >= _params.rx_window2_delay) {
|
||||||
_params.flags.bits.mac_done = 1;
|
_lora_time.stop(_params.timers.rx_window2_timer);
|
||||||
|
_params.flags.bits.mac_done = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
if ((rx_slot == RX_SLOT_WIN_2) || (_params.dev_class == CLASS_C)) {
|
||||||
|
// We need to process this case if the MAC is in class A or B for the 2nd RX window timeout.
|
||||||
|
// If the MAC is in class C, we need to process this part also for the 1st RX window timeout,
|
||||||
|
// as the 2nd window timer is not running.
|
||||||
|
|
||||||
if (_params.is_node_ack_requested == true) {
|
if (_params.is_node_ack_requested == true) {
|
||||||
mcps.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT;
|
mcps.get_confirmation().status = LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT;
|
||||||
|
|
Loading…
Reference in New Issue