diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index d30438c..142d362 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -35,6 +35,7 @@ m_latitude(0.0F), m_longitude(0.0F), m_height(0), m_desc(), +m_symbol(), m_suffix(suffix), m_aprsAddr(), m_aprsAddrLen(0U), @@ -63,11 +64,12 @@ CAPRSWriter::~CAPRSWriter() { } -void CAPRSWriter::setInfo(unsigned int txFrequency, unsigned int rxFrequency, const std::string& desc) +void CAPRSWriter::setInfo(unsigned int txFrequency, unsigned int rxFrequency, const std::string& desc, const std::string& symbol) { m_txFrequency = txFrequency; m_rxFrequency = rxFrequency; m_desc = desc; + m_symbol = symbol; } void CAPRSWriter::setStaticLocation(float latitude, float longitude, int height) @@ -268,17 +270,21 @@ void CAPRSWriter::sendIdFrameFixed() ::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&/A=%06.0f%s %s\r\n", + ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%c%c%s%c%c/A=%06.0f%s %s\r\n", m_callsign.c_str(), server.c_str(), - lat, (m_latitude < 0.0F) ? 'S' : 'N', - lon, (m_longitude < 0.0F) ? 'W' : 'E', + lat, (m_latitude < 0.0F) ? 'S' : 'N', symbol[0], + lon, (m_longitude < 0.0F) ? 'W' : 'E', symbol[1], float(m_height) * 3.28F, band, desc); if (m_debug) diff --git a/YSFGateway/APRSWriter.h b/YSFGateway/APRSWriter.h index 8fd4623..f503117 100644 --- a/YSFGateway/APRSWriter.h +++ b/YSFGateway/APRSWriter.h @@ -47,7 +47,7 @@ public: bool open(); - void setInfo(unsigned int txFrequency, unsigned int rxFrequency, const std::string& desc); + void setInfo(unsigned int txFrequency, unsigned int rxFrequency, const std::string& desc, const std::string& symbol); void setStaticLocation(float latitude, float longitude, int height); @@ -69,6 +69,7 @@ private: float m_longitude; int m_height; std::string m_desc; + std::string m_symbol; std::string m_suffix; sockaddr_storage m_aprsAddr; unsigned int m_aprsAddrLen; diff --git a/YSFGateway/Conf.cpp b/YSFGateway/Conf.cpp index d85fc1e..c9e39a9 100644 --- a/YSFGateway/Conf.cpp +++ b/YSFGateway/Conf.cpp @@ -60,6 +60,7 @@ m_longitude(0.0F), m_height(0), m_name(), m_description(), +m_aprsSymbol(), m_logDisplayLevel(0U), m_logFileLevel(0U), m_logFilePath(), @@ -235,6 +236,8 @@ bool CConf::read() m_aprsSuffix = value; else if (::strcmp(key, "Description") == 0) m_aprsDescription = value; + else if (::strcmp(key, "Symbol") == 0) + m_aprsSymbol = value; } else if (section == SECTION_NETWORK) { if (::strcmp(key, "Startup") == 0) m_networkStartup = value; @@ -443,6 +446,11 @@ std::string CConf::getAPRSDescription() const return m_aprsDescription; } +std::string CConf::getAPRSSymbol() const +{ + return m_aprsSymbol; +} + std::string CConf::getNetworkStartup() const { return m_networkStartup; diff --git a/YSFGateway/Conf.h b/YSFGateway/Conf.h index 3bbe38d..430613d 100644 --- a/YSFGateway/Conf.h +++ b/YSFGateway/Conf.h @@ -65,6 +65,7 @@ public: unsigned short getAPRSPort() const; std::string getAPRSSuffix() const; std::string getAPRSDescription() const; + std::string getAPRSSymbol() const; // The Network section std::string getNetworkStartup() const; @@ -135,6 +136,7 @@ private: unsigned short m_aprsPort; std::string m_aprsSuffix; std::string m_aprsDescription; + std::string m_aprsSymbol; std::string m_networkStartup; std::string m_networkOptions; diff --git a/YSFGateway/Version.h b/YSFGateway/Version.h index f2554c5..44e8fb3 100644 --- a/YSFGateway/Version.h +++ b/YSFGateway/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20211108"; +const char* VERSION = "20230212"; #endif diff --git a/YSFGateway/YSFGateway.cpp b/YSFGateway/YSFGateway.cpp index 9fbd9d1..bc6e948 100644 --- a/YSFGateway/YSFGateway.cpp +++ b/YSFGateway/YSFGateway.cpp @@ -469,8 +469,10 @@ void CYSFGateway::createGPS() unsigned int txFrequency = m_conf.getTxFrequency(); unsigned int rxFrequency = m_conf.getRxFrequency(); std::string desc = m_conf.getAPRSDescription(); + std::string symbol = m_conf.getAPRSSymbol(); + + m_writer->setInfo(txFrequency, rxFrequency, desc, symbol); - m_writer->setInfo(txFrequency, rxFrequency, desc); bool enabled = m_conf.getGPSDEnabled(); if (enabled) { diff --git a/YSFGateway/YSFGateway.ini b/YSFGateway/YSFGateway.ini index cc9f53e..decc4c8 100644 --- a/YSFGateway/YSFGateway.ini +++ b/YSFGateway/YSFGateway.ini @@ -36,6 +36,7 @@ Address=127.0.0.1 Port=8673 Description=APRS Description Suffix=Y +# Symbol=/r [Network] # Startup=FCS00120