1
0
Fork 0

Add new ini entry for the optional APRS description.

ycs232-kbc
Jonathan Naylor 7 years ago
parent 2f41b0eaab
commit 41015d21d3

@ -60,6 +60,7 @@ m_aprsEnabled(false),
m_aprsServer(), m_aprsServer(),
m_aprsPort(0U), m_aprsPort(0U),
m_aprsPassword(), m_aprsPassword(),
m_aprsDescription(),
m_networkEnabled(false), m_networkEnabled(false),
m_networkPort(0U), m_networkPort(0U),
m_networkHosts(), m_networkHosts(),
@ -170,6 +171,8 @@ bool CConf::read()
m_aprsPort = (unsigned int)::atoi(value); m_aprsPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "Password") == 0) else if (::strcmp(key, "Password") == 0)
m_aprsPassword = value; m_aprsPassword = value;
else if (::strcmp(key, "Description") == 0)
m_aprsDescription = value;
} else if (section == SECTION_NETWORK) { } else if (section == SECTION_NETWORK) {
if (::strcmp(key, "Enable") == 0) if (::strcmp(key, "Enable") == 0)
m_networkEnabled = ::atoi(value) == 1; m_networkEnabled = ::atoi(value) == 1;
@ -314,6 +317,11 @@ std::string CConf::getAPRSPassword() const
return m_aprsPassword; return m_aprsPassword;
} }
std::string CConf::getAPRSDescription() const
{
return m_aprsDescription;
}
bool CConf::getNetworkEnabled() const bool CConf::getNetworkEnabled() const
{ {
return m_networkEnabled; return m_networkEnabled;

@ -60,6 +60,7 @@ public:
std::string getAPRSServer() const; std::string getAPRSServer() const;
unsigned int getAPRSPort() const; unsigned int getAPRSPort() const;
std::string getAPRSPassword() const; std::string getAPRSPassword() const;
std::string getAPRSDescription() const;
// The Network section // The Network section
bool getNetworkEnabled() const; bool getNetworkEnabled() const;
@ -101,6 +102,7 @@ private:
std::string m_aprsServer; std::string m_aprsServer;
unsigned int m_aprsPort; unsigned int m_aprsPort;
std::string m_aprsPassword; std::string m_aprsPassword;
std::string m_aprsDescription;
bool m_networkEnabled; bool m_networkEnabled;
unsigned int m_networkPort; unsigned int m_networkPort;

@ -501,6 +501,7 @@ void CYSFGateway::createGPS()
std::string hostname = m_conf.getAPRSServer(); std::string hostname = m_conf.getAPRSServer();
unsigned int port = m_conf.getAPRSPort(); unsigned int port = m_conf.getAPRSPort();
std::string password = m_conf.getAPRSPassword(); std::string password = m_conf.getAPRSPassword();
std::string desc = m_conf.getAPRSDescription();
m_gps = new CGPS(m_callsign, m_suffix, password, hostname, port); m_gps = new CGPS(m_callsign, m_suffix, password, hostname, port);
@ -509,7 +510,6 @@ void CYSFGateway::createGPS()
float latitude = m_conf.getLatitude(); float latitude = m_conf.getLatitude();
float longitude = m_conf.getLongitude(); float longitude = m_conf.getLongitude();
int height = m_conf.getHeight(); int height = m_conf.getHeight();
std::string desc = m_conf.getDescription();
m_gps->setInfo(txFrequency, rxFrequency, latitude, longitude, height, desc); m_gps->setInfo(txFrequency, rxFrequency, latitude, longitude, height, desc);

@ -31,6 +31,7 @@ Enable=0
Server=euro.aprs2.net Server=euro.aprs2.net
Port=14580 Port=14580
Password=9999 Password=9999
Description=APRS Description
[Network] [Network]
Enable=1 Enable=1

Loading…
Cancel
Save