diff --git a/Common/NMEASentenceCollector.cpp b/Common/NMEASentenceCollector.cpp index c69e9e5..4ad660c 100644 --- a/Common/NMEASentenceCollector.cpp +++ b/Common/NMEASentenceCollector.cpp @@ -110,12 +110,12 @@ bool CNMEASentenceCollector::getDataInt(std::string& data) // 20230425 Fix for https://github.com/F4FXL/DStarGateway/issues/33 size_t hyphenIndex = fromCall.find('-'); - if(hyphenIndex == std::string::npos) { - fromCall.append("-5"); + if(hyphenIndex != std::string::npos) { + fromCall = fromCall.substr(0, hyphenIndex); } std::string aprsFrame(fromCall); - aprsFrame.append(">GPS30,DSTAR*:") + aprsFrame.append("-5>GPS30,DSTAR*:") .append(nmea); data.assign(aprsFrame); diff --git a/Tests/NMEASentenceCollector/callSignTests.cpp b/Tests/NMEASentenceCollector/callSignTests.cpp index 38dc805..1cb6718 100644 --- a/Tests/NMEASentenceCollector/callSignTests.cpp +++ b/Tests/NMEASentenceCollector/callSignTests.cpp @@ -82,6 +82,6 @@ namespace NMEASentenceCollectorTests m_collector->setMyCall2("5100"); m_collector->getData(data); - EXPECT_TRUE(data.find("N0CALL") != std::string::npos) << "Callsign in APRS frame shall be N0CALL-H"; + EXPECT_TRUE(data.find("N0CALL-5") != std::string::npos) << "Callsign in APRS frame shall be N0CALL"; } } \ No newline at end of file