DStar SelfOnly with WhiteList

This commit is contained in:
sp5lg
2019-10-06 16:15:25 +02:00
parent 87e60a81f8
commit ed79a7176a
6 changed files with 32 additions and 6 deletions

View File

@@ -123,6 +123,7 @@ m_dstarEnabled(false),
m_dstarModule("C"),
m_dstarSelfOnly(false),
m_dstarBlackList(),
m_dstarWhiteList(),
m_dstarAckReply(true),
m_dstarAckTime(750U),
m_dstarAckMessage(false),
@@ -513,7 +514,19 @@ bool CConf::read()
}
p = ::strtok(NULL, ",\r\n");
}
} else if (::strcmp(key, "AckReply") == 0)
} else if (::strcmp(key, "WhiteList") == 0) {
char* p = ::strtok(value, ",\r\n");
while (p != NULL) {
if (::strlen(p) > 0U) {
for (unsigned int i = 0U; p[i] != 0; i++)
p[i] = ::toupper(p[i]);
std::string callsign = std::string(p);
callsign.resize(DSTAR_LONG_CALLSIGN_LENGTH, ' ');
m_dstarWhiteList.push_back(callsign);
}
p = ::strtok(NULL, ",\r\n");
}
} else if (::strcmp(key, "AckReply") == 0)
m_dstarAckReply = ::atoi(value) == 1;
else if (::strcmp(key, "AckTime") == 0)
m_dstarAckTime = (unsigned int)::atoi(value);
@@ -1136,6 +1149,11 @@ std::vector<std::string> CConf::getDStarBlackList() const
return m_dstarBlackList;
}
std::vector<std::string> CConf::getDStarWhiteList() const
{
return m_dstarWhiteList;
}
bool CConf::getDStarAckReply() const
{
return m_dstarAckReply;