From d16e40726960e907bad0856bde67f2b834afe432 Mon Sep 17 00:00:00 2001 From: SQ2CPA Date: Thu, 4 Apr 2024 17:58:07 +0200 Subject: [PATCH] improvement: use LoRa WX icon when using BME --- src/gps_utils.cpp | 1 - src/utils.cpp | 5 +++-- src/web_utils.cpp | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gps_utils.cpp b/src/gps_utils.cpp index b35c4fc..38a562b 100644 --- a/src/gps_utils.cpp +++ b/src/gps_utils.cpp @@ -87,7 +87,6 @@ namespace GPS_Utils { } else {} beaconPacket += ":=" + stationLatitude + Config.beacon.overlay + stationLongitude + Config.beacon.symbol; - beaconPacket += Config.beacon.comment; return beaconPacket; } diff --git a/src/utils.cpp b/src/utils.cpp index 5d9ee65..492903a 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -108,10 +108,11 @@ namespace Utils { if (Config.bme.active) { String sensorData = BME_Utils::readDataSensor(); - beaconPacket = iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + sensorData + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21); + + beaconPacket = iGateBeaconPacket + sensorData + Config.beacon.comment; secondaryBeaconPacket = iGateLoRaBeaconPacket + sensorData + Config.beacon.comment; } else { - beaconPacket = iGateBeaconPacket; + beaconPacket = iGateBeaconPacket + Config.beacon.comment; secondaryBeaconPacket = iGateLoRaBeaconPacket + Config.beacon.comment; } diff --git a/src/web_utils.cpp b/src/web_utils.cpp index 8a719e8..e71a27c 100644 --- a/src/web_utils.cpp +++ b/src/web_utils.cpp @@ -158,6 +158,10 @@ namespace WEB_Utils { Config.lowPowerMode = request->hasParam("other.lowPowerMode", true); Config.lowVoltageCutOff = request->getParam("other.lowVoltageCutOff", true)->value().toDouble(); + if (Config.bme.active) { + Config.beacon.symbol = "_"; + } + Config.writeFile(); AsyncWebServerResponse *response = request->beginResponse(302, "text/html", "");