Skip to content

Commit 0d3ec26

Browse files
author
Hasnain Virk
committed
Proper handling of RX1 frequency in rx_config
Previously, we weren't filling in RX1 frequecny in rx_window1_config structure. However, everything worked as in LoRaPHY::rx_config() API there was a check which filled in correct RX1 frequency. Now we are filling in RX1 freq. properly while we are computing parameters for RX1 window.
1 parent 19e87ce commit 0d3ec26

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

features/lorawan/lorastack/mac/LoRaMac.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ void LoRaMac::open_rx1_window(void)
903903
_lora_phy->rx_config(&_params.rx_window1_config);
904904
_lora_phy->handle_receive();
905905

906-
tr_debug("Opening RX1 Window");
906+
tr_debug("RX1 slot open, Freq = %lu", _params.rx_window1_config.frequency);
907907
}
908908

909909
void LoRaMac::open_rx2_window()
@@ -932,7 +932,7 @@ void LoRaMac::open_rx2_window()
932932
_lora_phy->handle_receive();
933933
_params.rx_slot = _params.rx_window2_config.rx_slot;
934934

935-
tr_debug("Opening RX2 Window, Frequency = %lu", _params.rx_window2_config.frequency);
935+
tr_debug("RX2 slot open, Freq = %lu", _params.rx_window2_config.frequency);
936936
}
937937

938938
void LoRaMac::on_ack_timeout_timer_event(void)

features/lorawan/lorastack/phy/LoRaPHY.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,11 @@ void LoRaPHY::compute_rx_win_params(int8_t datarate, uint8_t min_rx_symbols,
849849
((uint32_t *)phy_params.bandwidths.table)[rx_conf_params->datarate]);
850850
}
851851

852+
if (rx_conf_params->rx_slot == RX_SLOT_WIN_1) {
853+
rx_conf_params->frequency = phy_params.channels.channel_list[rx_conf_params->channel].frequency;
854+
}
855+
856+
852857
get_rx_window_params(t_symbol, min_rx_symbols, rx_error, RADIO_WAKEUP_TIME,
853858
&rx_conf_params->window_timeout, &rx_conf_params->window_offset);
854859
}

0 commit comments

Comments
 (0)