From b743f1a6e80a28555f37f16fa41f18eb538146a5 Mon Sep 17 00:00:00 2001 From: Chipster Date: Mon, 13 Feb 2023 09:28:41 -0600 Subject: [PATCH] For DGId and YSF Gatweays, add missing symbol func. in offset/no-offset cconditions --- DGIdGateway/APRSWriter.cpp | 10 +++++++--- YSFGateway/APRSWriter.cpp | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/DGIdGateway/APRSWriter.cpp b/DGIdGateway/APRSWriter.cpp index 142d362..a4beeea 100644 --- a/DGIdGateway/APRSWriter.cpp +++ b/DGIdGateway/APRSWriter.cpp @@ -368,17 +368,21 @@ void CAPRSWriter::sendIdFrameMobile() ::sprintf(lon, "%08.2lf", longitude); std::string server = m_callsign; + std::string symbol = m_symbol; size_t pos = server.find_first_of('-'); if (pos == std::string::npos) server.append("-S"); else server.append("S"); + if (symbol.empty()) + symbol.append("D&"); + char output[500U]; - ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%cD%s%c&", + ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%c%c%s%c%c", m_callsign.c_str(), server.c_str(), - lat, (rawLatitude < 0.0F) ? 'S' : 'N', - lon, (rawLongitude < 0.0F) ? 'W' : 'E'); + lat, (rawLatitude < 0.0F) ? 'S' : 'N', symbol[0], + lon, (rawLongitude < 0.0F) ? 'W' : 'E', symbol[1]); if (bearingSet && velocitySet) ::sprintf(output + ::strlen(output), "%03.0f/%03.0f", rawBearing, rawVelocity * 0.539957F); diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index 142d362..46b0fbc 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -368,17 +368,21 @@ void CAPRSWriter::sendIdFrameMobile() ::sprintf(lon, "%08.2lf", longitude); std::string server = m_callsign; - size_t pos = server.find_first_of('-'); - if (pos == std::string::npos) - server.append("-S"); - else - server.append("S"); + std::string symbol = m_symbol; + size_t pos = server.find_first_of('-'); + if (pos == std::string::npos) + server.append("-S"); + else + server.append("S"); + + if (symbol.empty()) + symbol.append("D&"); char output[500U]; - ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%cD%s%c&", + ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%c%c%s%c%c", m_callsign.c_str(), server.c_str(), - lat, (rawLatitude < 0.0F) ? 'S' : 'N', - lon, (rawLongitude < 0.0F) ? 'W' : 'E'); + lat, (rawLatitude < 0.0F) ? 'S' : 'N', symbol[0], + lon, (rawLongitude < 0.0F) ? 'W' : 'E', symbol[1]); if (bearingSet && velocitySet) ::sprintf(output + ::strlen(output), "%03.0f/%03.0f", rawBearing, rawVelocity * 0.539957F);