From 153b13795300e0ba06866fde54c28501d09d8084 Mon Sep 17 00:00:00 2001 From: Kimmo Vaisanen Date: Tue, 20 Mar 2018 14:38:44 +0200 Subject: [PATCH] Lora: Fix resetting of max_eirp and antenna_gain values This is a fix for issue #6391 max_eirp and antenna_gain are floating point variables. Values of these were incorrectly read from MIB as integer and therefore incorrect values were set. --- features/lorawan/lorastack/mac/LoRaMac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/lorawan/lorastack/mac/LoRaMac.cpp b/features/lorawan/lorastack/mac/LoRaMac.cpp index ab5c2b9358..b6516c0c91 100644 --- a/features/lorawan/lorastack/mac/LoRaMac.cpp +++ b/features/lorawan/lorastack/mac/LoRaMac.cpp @@ -1332,11 +1332,11 @@ void LoRaMac::reset_mac_parameters(void) get_phy.attribute = PHY_DEF_MAX_EIRP; phy_param = lora_phy->get_phy_params(&get_phy); - _params.sys_params.max_eirp = phy_param.value; + _params.sys_params.max_eirp = phy_param.f_value; get_phy.attribute = PHY_DEF_ANTENNA_GAIN; phy_param = lora_phy->get_phy_params(&get_phy); - _params.sys_params.antenna_gain = phy_param.value; + _params.sys_params.antenna_gain = phy_param.f_value; _params.is_node_ack_requested = false; _params.is_srv_ack_requested = false;