mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-26 03:15:40 +08:00
Clean up the MQTT connection authentication configuration.
This commit is contained in:
25
Conf.cpp
25
Conf.cpp
@@ -123,8 +123,8 @@ m_mqttPort(1883),
|
||||
m_mqttKeepalive(60U),
|
||||
m_mqttName("mmdvm"),
|
||||
m_mqttAuthEnabled(false),
|
||||
m_mqttUser("mqttuser"),
|
||||
m_mqttPass("mqttpass"),
|
||||
m_mqttUsername(),
|
||||
m_mqttPassword(),
|
||||
m_cwIdEnabled(false),
|
||||
m_cwIdTime(10U),
|
||||
m_cwIdCallsign(),
|
||||
@@ -612,13 +612,12 @@ bool CConf::read()
|
||||
m_mqttKeepalive = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Name") == 0)
|
||||
m_mqttName = value;
|
||||
else if (::strcmp(key, "Auth") == 0)
|
||||
m_mqttAuthEnabled = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "User") == 0)
|
||||
m_mqttUser = value;
|
||||
else if (::strcmp(key, "Pass") == 0)
|
||||
m_mqttPass = value;
|
||||
|
||||
else if (::strcmp(key, "Auth") == 0)
|
||||
m_mqttAuthEnabled = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "Username") == 0)
|
||||
m_mqttUsername = value;
|
||||
else if (::strcmp(key, "Password") == 0)
|
||||
m_mqttPassword = value;
|
||||
} else if (section == SECTION_CWID) {
|
||||
if (::strcmp(key, "Enable") == 0)
|
||||
m_cwIdEnabled = ::atoi(value) == 1;
|
||||
@@ -1337,14 +1336,14 @@ bool CConf::getMQTTAuthEnabled() const
|
||||
return m_mqttAuthEnabled;
|
||||
}
|
||||
|
||||
std::string CConf::getMQTTUser() const
|
||||
std::string CConf::getMQTTUsername() const
|
||||
{
|
||||
return m_mqttUser;
|
||||
return m_mqttUsername;
|
||||
}
|
||||
|
||||
std::string CConf::getMQTTPass() const
|
||||
std::string CConf::getMQTTPassword() const
|
||||
{
|
||||
return m_mqttPass;
|
||||
return m_mqttPassword;
|
||||
}
|
||||
|
||||
bool CConf::getCWIdEnabled() const
|
||||
|
||||
Reference in New Issue
Block a user