From 1ddd460eec250a95d6359a7cc0fabde1c808a305 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Thu, 6 Jul 2023 01:08:01 -0400 Subject: [PATCH] added Battery Info to Comment --- src/utils.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 3fb7f1f..1dd2b50 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -99,6 +99,14 @@ void checkBeaconInterval() { Serial.println("---- Sending iGate Beacon ----"); STATION_Utils::deleteNotHeard(); activeStations(); + if (Config.bme.active) { + beaconPacket = iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + BME_Utils::readDataSensor() + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21) + " + WX"; + } else { + beaconPacket = iGateBeaconPacket; + } + if (Config.sendBatteryVoltage) { + beaconPacket += " (Batt=" + String(BATTERY_Utils::checkVoltages(),2) + "V)"; + } if (stationMode==1 || stationMode==2) { thirdLine = getLocalIP(); if (!Config.bme.active) { @@ -107,14 +115,6 @@ void checkBeaconInterval() { sixthLine = ""; show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 1000); seventhLine = " listening..."; - if (Config.bme.active) { - beaconPacket = iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + BME_Utils::readDataSensor() + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21) + " + WX"; - } else { - beaconPacket = iGateBeaconPacket; - } - if (Config.sendBatteryVoltage) { - beaconPacket += " (Batt=" + String(BATTERY_Utils::checkVoltages(),2) + "V)"; - } espClient.write((beaconPacket + "\n").c_str()); show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } else if (stationMode==3 || stationMode==4) { @@ -133,14 +133,6 @@ void checkBeaconInterval() { if (stationMode == 4) { LoRa_Utils::changeFreqTx(); } - if (Config.bme.active) { - beaconPacket = iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + BME_Utils::readDataSensor() + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21) + " + WX"; - } else { - beaconPacket = iGateBeaconPacket; - } - if (Config.sendBatteryVoltage) { - beaconPacket += " (Batt=" + String(BATTERY_Utils::checkVoltages(),2) + "V)"; - } LoRa_Utils::sendNewPacket("APRS", beaconPacket); if (stationMode == 4) { LoRa_Utils::changeFreqRx();