From 928c68cd7f27a197779263eddc40fba255af8e24 Mon Sep 17 00:00:00 2001 From: Hasnain Virk Date: Mon, 20 Aug 2018 14:35:40 +0300 Subject: [PATCH] Restoring default RX2 data rate In #b0b0261 we changed the RX2 data rate to start from the highest data rate available for the PHY rather than standard defined DR. This introduced a regression, i.e., even when somebody changed the default RX2 data rate to something usable for their environment, it didn't take any effect. As in reset_mac_params() we override the data rate with max value possible for that PHY. This commit restores the original behaviour and we always use standard defined values. --- features/lorawan/lorastack/phy/LoRaPHY.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/features/lorawan/lorastack/phy/LoRaPHY.cpp b/features/lorawan/lorastack/phy/LoRaPHY.cpp index 84032956f7..ce2f7a4363 100644 --- a/features/lorawan/lorastack/phy/LoRaPHY.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHY.cpp @@ -522,8 +522,7 @@ void LoRaPHY::reset_to_default_values(loramac_protocol_params *params, bool init params->sys_params.rx2_channel.frequency = get_default_rx2_frequency(); - // RX2 data rate should also start from the maximum - params->sys_params.rx2_channel.datarate = get_default_max_tx_datarate(); + params->sys_params.rx2_channel.datarate = get_default_rx2_datarate(); params->sys_params.uplink_dwell_time = phy_params.ul_dwell_time_setting;