From 263c6985d863ebd1f6382f91248ef1cf5e09ccce Mon Sep 17 00:00:00 2001 From: Nat Moore Date: Thu, 10 Feb 2022 17:32:11 -0600 Subject: [PATCH] do some json tweaks --- network/Network.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/network/Network.cpp b/network/Network.cpp index 0abae3d6..b55744c1 100644 --- a/network/Network.cpp +++ b/network/Network.cpp @@ -507,29 +507,13 @@ bool Network::writeConfig() sysInfo["latitude"].set(m_latitude); // Latitude sysInfo["longitude"].set(m_longitude); // Longitude - int height = m_height; - if (m_height > 999) - height = 999; - - sysInfo["height"].set(height); // Height - - // clamp location to 20 characters - if (m_location.length() > 20) { - std::string location = m_location; - m_location = location.substr(0, 20); - } - + sysInfo["height"].set(m_height); // Height sysInfo["location"].set(m_location); // Location - - int power = m_power; - if (m_power > 99U) - power = 99U; - - sysInfo["power"].set(power); // Tx Power config["info"].set(sysInfo); // channel data json::object channel = json::object(); + channel["txPower"].set(m_power); // Tx Power channel["txOffsetMhz"].set(m_txOffsetMhz); // Tx Offset (Mhz) channel["chBandwidthKhz"].set(m_chBandwidthKhz); // Ch. Bandwidth (khz) channel["channelId"].set(m_channelId); // Channel ID