Merge branch 'mqtt' into mqtt_plus

This commit is contained in:
Jonathan Naylor
2023-12-06 17:36:56 +00:00
4 changed files with 13 additions and 6 deletions

View File

@@ -564,7 +564,10 @@ void CM17Control::writeNetwork()
m_networkWatchdog.start();
if (!m_allowEncryption) {
unsigned char type = m_netLSF.getEncryptionType();
CM17LSF lsf;
lsf.setNetwork(netData);
unsigned char type = lsf.getEncryptionType();
if (type != M17_ENCRYPTION_TYPE_NONE) {
m_network->reset();
return;

View File

@@ -40,6 +40,8 @@ m_lsf(NULL),
m_valid(false)
{
m_lsf = new unsigned char[M17_LSF_LENGTH_BYTES];
::memset(m_lsf, 0x00U, M17_LSF_LENGTH_BYTES);
}
CM17LSF::~CM17LSF()

View File

@@ -105,7 +105,7 @@ bool CM17Network::write(const unsigned char* data)
buffer[53U] = 0x00U;
if (m_debug)
CUtils::dump(1U, "M17 data transmitted", buffer, 54U);
CUtils::dump(1U, "M17 Network Transmitted", buffer, 54U);
return m_socket.write(buffer, 54U, m_addr, m_addrLen);
}
@@ -132,7 +132,7 @@ void CM17Network::clock(unsigned int ms)
}
if (m_debug)
CUtils::dump(1U, "M17 Network Data Received", buffer, length);
CUtils::dump(1U, "M17 Network Received", buffer, length);
if (!m_enabled)
return;
@@ -189,7 +189,9 @@ void CM17Network::reset()
void CM17Network::enable(bool enabled)
{
if (!enabled && m_enabled)
if (enabled && !m_enabled)
reset();
else if (!enabled && m_enabled)
m_buffer.clear();
m_enabled = enabled;
@@ -210,7 +212,7 @@ void CM17Network::sendPing()
buffer[3U] = 'G';
if (m_debug)
CUtils::dump(1U, "M17 data transmitted", buffer, 4U);
CUtils::dump(1U, "M17 Network Transmitted", buffer, 4U);
m_socket.write(buffer, 4U, m_addr, m_addrLen);
}

View File

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