From 691f60925ad29c20a9d9a2b585e86d81eed0f61a Mon Sep 17 00:00:00 2001 From: richonguzman Date: Tue, 18 Jun 2024 16:45:01 -0400 Subject: [PATCH] only digi with packetbuffer25seg --- src/LoRa_APRS_iGate.cpp | 8 +++---- src/aprs_is_utils.cpp | 50 ++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 6008909..0dec483 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -162,7 +162,8 @@ void loop() { } if (Config.digi.mode == 2 || backUpDigiMode) { // If Digi enabled - DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi + STATION_Utils::clean25SegBuffer(); + DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi } if (Config.tnc.enableServer) { // If TNC server enabled @@ -176,9 +177,8 @@ void loop() { if (Config.aprs_is.active) { // If APRSIS enabled APRS_IS_Utils::listenAPRSIS(); // listen received packet from APRSIS } - - STATION_Utils::processOutputPacketBuffer(); - STATION_Utils::clean25SegBuffer(); + + STATION_Utils::processOutputPacketBuffer(); show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); Utils::checkRebootTime(); diff --git a/src/aprs_is_utils.cpp b/src/aprs_is_utils.cpp index 1879c11..0145594 100644 --- a/src/aprs_is_utils.cpp +++ b/src/aprs_is_utils.cpp @@ -200,34 +200,32 @@ namespace APRS_IS_Utils { if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("TCPIP") == -1) && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) { Sender = packet.substring(3, packet.indexOf(">")); if (Sender != Config.callsign && Utils::checkValidCallsign(Sender)) { - if (STATION_Utils::check25SegBuffer(Sender, packet.substring(packet.indexOf(":")+2))) { - STATION_Utils::updateLastHeard(Sender); - Utils::typeOfPacket(packet.substring(3), 0); // LoRa-APRS - AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2); - Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":")); - Addressee.trim(); - if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me! - if (AddresseeAndMessage.indexOf("\x3c\xff\x01") != -1) { - AddresseeAndMessage = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf("\x3c\xff\x01")); - } - queryMessage = processReceivedLoRaMessage(Sender, AddresseeAndMessage); + STATION_Utils::updateLastHeard(Sender); + Utils::typeOfPacket(packet.substring(3), 0); // LoRa-APRS + AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2); + Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":")); + Addressee.trim(); + if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me! + if (AddresseeAndMessage.indexOf("\x3c\xff\x01") != -1) { + AddresseeAndMessage = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf("\x3c\xff\x01")); } - if (!queryMessage) { - aprsPacket = buildPacketToUpload(packet); - if (!Config.display.alwaysOn && Config.display.timeout != 0) { - display_toggle(true); - } - lastScreenOn = millis(); - #ifdef ESP32_DIY_LoRa_A7670 - stationBeacon = true; - A7670_Utils::uploadToAPRSIS(aprsPacket); - stationBeacon = false; - #else - upload(aprsPacket); - #endif - Utils::println("---> Uploaded to APRS-IS"); - show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); + queryMessage = processReceivedLoRaMessage(Sender, AddresseeAndMessage); + } + if (!queryMessage) { + aprsPacket = buildPacketToUpload(packet); + if (!Config.display.alwaysOn && Config.display.timeout != 0) { + display_toggle(true); } + lastScreenOn = millis(); + #ifdef ESP32_DIY_LoRa_A7670 + stationBeacon = true; + A7670_Utils::uploadToAPRSIS(aprsPacket); + stationBeacon = false; + #else + upload(aprsPacket); + #endif + Utils::println("---> Uploaded to APRS-IS"); + show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } } }