mirror of
https://github.com/g4klx/DMRGateway
synced 2025-12-21 05:25:40 +08:00
Ensure the correct width of the configuration packet.
This commit is contained in:
@@ -1508,7 +1508,6 @@ bool CDMRGateway::createDMRNetwork2()
|
|||||||
|
|
||||||
unsigned char config[400U];
|
unsigned char config[400U];
|
||||||
unsigned int len = getConfig(m_dmr2Name, config);
|
unsigned int len = getConfig(m_dmr2Name, config);
|
||||||
|
|
||||||
m_dmrNetwork2->setConfig(config, len);
|
m_dmrNetwork2->setConfig(config, len);
|
||||||
|
|
||||||
bool ret = m_dmrNetwork2->open();
|
bool ret = m_dmrNetwork2->open();
|
||||||
@@ -2246,7 +2245,6 @@ bool CDMRGateway::linkXLX(unsigned int number)
|
|||||||
|
|
||||||
unsigned char config[400U];
|
unsigned char config[400U];
|
||||||
unsigned int len = getConfig("XLX", config);
|
unsigned int len = getConfig("XLX", config);
|
||||||
|
|
||||||
m_xlxNetwork->setConfig(config, len);
|
m_xlxNetwork->setConfig(config, len);
|
||||||
|
|
||||||
bool ret = m_xlxNetwork->open();
|
bool ret = m_xlxNetwork->open();
|
||||||
@@ -2364,7 +2362,7 @@ unsigned int CDMRGateway::getConfig(const std::string& name, unsigned char* buff
|
|||||||
std::string description = m_conf.getInfoDescription();
|
std::string description = m_conf.getInfoDescription();
|
||||||
std::string url = m_conf.getInfoURL();
|
std::string url = m_conf.getInfoURL();
|
||||||
|
|
||||||
::sprintf((char*)buffer, "%8.8s%9.9s%9.9s%2.2s%2.2s%9.9s%9.9s%03d%-20.20s%-19.19s%c%-124.124s%40.40s%40.40s",
|
::sprintf((char*)buffer, "%8.8s%9.9s%9.9s%2.2s%2.2s%8.8s%9.9s%03d%-20.20s%-19.19s%c%-124.124s%40.40s%40.40s",
|
||||||
m_config + 0U, m_config + 8U, m_config + 17U, m_config + 26U, m_config + 28U,
|
m_config + 0U, m_config + 8U, m_config + 17U, m_config + 26U, m_config + 28U,
|
||||||
latitude, longitude, height, location.c_str(),
|
latitude, longitude, height, location.c_str(),
|
||||||
description.c_str(), m_config[30U], url.c_str(), m_config + 31U, m_config + 71U);
|
description.c_str(), m_config[30U], url.c_str(), m_config + 31U, m_config + 71U);
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ bool CDMRNetwork::writeConfig()
|
|||||||
::memcpy(buffer + 222U, software, ::strlen(software));
|
::memcpy(buffer + 222U, software, ::strlen(software));
|
||||||
|
|
||||||
if (!m_location)
|
if (!m_location)
|
||||||
::memcpy(buffer + 30U, "0.00000000.000000", 17U);
|
::memcpy(buffer + 38U, "0.00000000.000000", 17U);
|
||||||
|
|
||||||
return write((unsigned char*)buffer, m_configLen + 8U);
|
return write((unsigned char*)buffer, m_configLen + 8U);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user