From 333757829fe58160ad5f792c989aa4fc325fa8b7 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Wed, 6 Dec 2023 14:06:48 +0000 Subject: [PATCH] Add even more debugging. --- M17Control.cpp | 10 +++++++++- M17Network.cpp | 14 ++++++++++---- Version.h | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/M17Control.cpp b/M17Control.cpp index 192b5faa..f461e01c 100644 --- a/M17Control.cpp +++ b/M17Control.cpp @@ -539,10 +539,13 @@ void CM17Control::writeNetwork() if (!exists) return; - if (!m_enabled) + if (!m_enabled) { + LogMessage("M17 not enabled"); return; + } if (m_rfState != RS_RF_LISTENING && m_rfState != RS_RF_LATE_ENTRY && m_netState == RS_NET_IDLE) { + LogMessage("M17 status is incorrect %d,%d", m_rfState, m_netState); m_network->reset(); return; } @@ -552,6 +555,7 @@ void CM17Control::writeNetwork() if (!m_allowEncryption) { unsigned char type = m_netLSF.getEncryptionType(); if (type != M17_ENCRYPTION_TYPE_NONE) { + LogMessage("M17 encryption rejection"); m_network->reset(); return; } @@ -616,6 +620,8 @@ void CM17Control::writeNetwork() decorrelator(temp, start + 2U); writeQueueNet(start); + } else { + LogMessage("M17 in an odd state 1 %d", m_netState); } if (m_netState == RS_NET_AUDIO || m_netState == RS_NET_DATA_AUDIO) { @@ -728,6 +734,8 @@ void CM17Control::writeNetwork() writeEndNet(); } + } else { + LogMessage("M17 in an odd state 2 %d", m_netState); } } diff --git a/M17Network.cpp b/M17Network.cpp index 241cd932..ed36ec7d 100644 --- a/M17Network.cpp +++ b/M17Network.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020,2021 by Jonathan Naylor G4KLX + * Copyright (C) 2020,2021,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -133,8 +133,10 @@ void CM17Network::clock(unsigned int ms) if (m_debug) CUtils::dump(1U, "M17 Network Received", buffer, length); - if (!m_enabled) + if (!m_enabled) { + LogMessage("M17 Network not enabled"); return; + } if (::memcmp(buffer + 0U, "PING", 4U) == 0) return; @@ -148,8 +150,10 @@ void CM17Network::clock(unsigned int ms) if (m_inId == 0U) { m_inId = id; } else { - if (id != m_inId) + if (id != m_inId) { + LogMessage("M17 Network id rejection"); return; + } } unsigned char c = length - 6U; @@ -188,7 +192,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; diff --git a/Version.h b/Version.h index 439756d2..2d9289c4 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20231025"; +const char* VERSION = "20231206"; #endif