From 1d62395d79c819199c88882611d6bf84b32dc2bb Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 24 Jun 2024 12:15:46 -0400 Subject: [PATCH] digirepeater Colon fix --- lib/APRSPacketLib/APRSPacketLib.cpp | 4 +++- src/msg_utils.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/APRSPacketLib/APRSPacketLib.cpp b/lib/APRSPacketLib/APRSPacketLib.cpp index ce6515c..67ed035 100644 --- a/lib/APRSPacketLib/APRSPacketLib.cpp +++ b/lib/APRSPacketLib/APRSPacketLib.cpp @@ -269,7 +269,9 @@ namespace APRSPacketLib { String generateDigiRepeatedPacket(const String& packet, const String &callsign, const String& path) { bool thirdParty = false; - if (packet.indexOf(":}") != -1) thirdParty = true; + + int firstColonIndex = packet.indexOf(":"); + if (firstColonIndex > 0 && firstColonIndex < packet.length() && packet[firstColonIndex + 1] == '}') thirdParty = true; String temp; if (thirdParty) { // only header is used diff --git a/src/msg_utils.cpp b/src/msg_utils.cpp index 8ae4a62..9067667 100644 --- a/src/msg_utils.cpp +++ b/src/msg_utils.cpp @@ -419,7 +419,7 @@ namespace MSG_Utils { if (digirepeaterActive && lastReceivedPacket.addressee != currentBeacon->callsign) { String digiRepeatedPacket = APRSPacketLib::generateDigiRepeatedPacket(packet.text, currentBeacon->callsign, Config.path); if (digiRepeatedPacket == "X") { - logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "%s", "Packet won't be Repeated (Missing WIDE1-X)"); + logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "%s", "Packet won't be Repeated (Missing WIDEn-N)"); } else { delay(500); LoRa_Utils::sendNewPacket(digiRepeatedPacket);