mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-06 06:53:42 +00:00
Clean up the MQTT connection authentication configuration.
This commit is contained in:
parent
dcee575722
commit
f9a5a169cb
6 changed files with 29 additions and 30 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue