mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:17:09 +08:00
Merge pull request #522 from sp5lg/master
DStar SelfOnly with WhiteList
This commit is contained in:
18
Conf.cpp
18
Conf.cpp
@@ -126,6 +126,7 @@ m_dstarEnabled(false),
|
||||
m_dstarModule("C"),
|
||||
m_dstarSelfOnly(false),
|
||||
m_dstarBlackList(),
|
||||
m_dstarWhiteList(),
|
||||
m_dstarAckReply(true),
|
||||
m_dstarAckTime(750U),
|
||||
m_dstarAckMessage(false),
|
||||
@@ -567,6 +568,18 @@ bool CConf::read()
|
||||
}
|
||||
p = ::strtok(NULL, ",\r\n");
|
||||
}
|
||||
} 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)
|
||||
@@ -1294,6 +1307,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;
|
||||
|
||||
Reference in New Issue
Block a user