1
0
Fork 0

Fix more APRS bugs.

ycs232-kbc
Jonathan Naylor 9 years ago
parent 9e76b24e7a
commit 5818e8ad6a

@ -37,7 +37,6 @@ CAPRSWriterThread::CAPRSWriterThread(const std::string& callsign, const std::str
CThread(),
m_username(callsign),
m_password(password),
m_ssid(callsign),
m_socket(address, port),
m_queue(20U, "APRS Queue"),
m_exit(false),
@ -54,15 +53,12 @@ m_clientName("YSFGateway")
m_username.resize(CALLSIGN_LENGTH, ' ');
m_username.erase(std::find_if(m_username.rbegin(), m_username.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), m_username.end());
std::transform(m_username.begin(), m_username.end(), m_username.begin(), ::toupper);
m_ssid = m_ssid.substr(CALLSIGN_LENGTH - 1U, 1);
}
CAPRSWriterThread::CAPRSWriterThread(const std::string& callsign, const std::string& password, const std::string& address, unsigned int port, const std::string& filter, const std::string& clientName) :
CThread(),
m_username(callsign),
m_password(password),
m_ssid(callsign),
m_socket(address, port),
m_queue(20U, "APRS Queue"),
m_exit(false),
@ -79,8 +75,6 @@ m_clientName(clientName)
m_username.resize(CALLSIGN_LENGTH, ' ');
m_username.erase(std::find_if(m_username.rbegin(), m_username.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), m_username.end());
std::transform(m_username.begin(), m_username.end(), m_username.begin(), ::toupper);
m_ssid = m_ssid.substr(CALLSIGN_LENGTH - 1U, 1);
}
CAPRSWriterThread::~CAPRSWriterThread()
@ -225,7 +219,7 @@ bool CAPRSWriterThread::connect()
filter.insert(0U, " filter ");
char connectString[200U];
::sprintf(connectString, "user %s-%s pass %s vers %s%s\n", m_username.c_str(), m_ssid.c_str(), m_password.c_str(), (m_clientName.length() ? m_clientName : "YSFGateway").c_str(), filter.c_str());
::sprintf(connectString, "user %s pass %s vers %s%s\n", m_username.c_str(), m_password.c_str(), (m_clientName.length() ? m_clientName : "YSFGateway").c_str(), filter.c_str());
ret = m_socket.writeLine(std::string(connectString));
if (!ret) {

@ -48,7 +48,6 @@ public:
private:
std::string m_username;
std::string m_password;
std::string m_ssid;
CTCPSocket m_socket;
CRingBuffer<char*> m_queue;
bool m_exit;

@ -57,7 +57,7 @@ m_logFileLevel(0U),
m_logFilePath(),
m_logFileRoot(),
m_aprsEnabled(false),
m_aprsHostname(),
m_aprsServer(),
m_aprsPort(0U),
m_aprsPassword(),
m_networkEnabled(false),
@ -159,8 +159,8 @@ bool CConf::read()
} else if (section == SECTION_APRS_FI) {
if (::strcmp(key, "Enable") == 0)
m_aprsEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Hostname") == 0)
m_aprsHostname = value;
else if (::strcmp(key, "Server") == 0)
m_aprsServer = value;
else if (::strcmp(key, "Port") == 0)
m_aprsPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "Password") == 0)
@ -284,9 +284,9 @@ bool CConf::getAPRSEnabled() const
return m_aprsEnabled;
}
std::string CConf::getAPRSHostname() const
std::string CConf::getAPRSServer() const
{
return m_aprsHostname;
return m_aprsServer;
}
unsigned int CConf::getAPRSPort() const

@ -57,7 +57,7 @@ public:
// The aprs.fi section
bool getAPRSEnabled() const;
std::string getAPRSHostname() const;
std::string getAPRSServer() const;
unsigned int getAPRSPort() const;
std::string getAPRSPassword() const;
@ -93,7 +93,7 @@ private:
std::string m_logFileRoot;
bool m_aprsEnabled;
std::string m_aprsHostname;
std::string m_aprsServer;
unsigned int m_aprsPort;
std::string m_aprsPassword;

@ -314,7 +314,7 @@ void CYSFGateway::createGPS()
if (!m_conf.getAPRSEnabled())
return;
std::string hostname = m_conf.getAPRSHostname();
std::string hostname = m_conf.getAPRSServer();
unsigned int port = m_conf.getAPRSPort();
std::string password = m_conf.getAPRSPassword();

Loading…
Cancel
Save