Ensure the correct width of the configuration packet.

This commit is contained in:
Jonathan Naylor
2020-08-28 10:58:33 +01:00
parent 1606c4e644
commit 8ef67976ab
3 changed files with 3 additions and 5 deletions

View File

@@ -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);

View File

@@ -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);
} }

View File

@@ -19,6 +19,6 @@
#if !defined(VERSION_H) #if !defined(VERSION_H)
#define VERSION_H #define VERSION_H
const char* VERSION = "20200827"; const char* VERSION = "20200828";
#endif #endif