From d37122a25355ea2840716e205f8e0d09338985c8 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Thu, 21 Oct 2021 20:26:51 +0000 Subject: [PATCH] skip network data processing if mode is not enabled; --- host/Host.cpp | 2 +- network/Network.cpp | 10 +++++++--- network/Network.h | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/host/Host.cpp b/host/Host.cpp index 9ef58b95..3c0a080e 100644 --- a/host/Host.cpp +++ b/host/Host.cpp @@ -1583,7 +1583,7 @@ bool Host::createNetwork() LogInfo(" Debug: yes"); } - m_network = new Network(address, port, local, id, password, m_duplex, debug, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer, updateLookup); + m_network = new Network(address, port, local, id, password, m_duplex, debug, m_dmrEnabled, m_p25Enabled, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer, updateLookup); m_network->setLookups(m_ridLookup, m_tidLookup); m_network->setMetadata(m_identity, m_rxFrequency, m_txFrequency, entry.txOffsetMhz(), entry.chBandwidthKhz(), m_channelId, m_channelNo, diff --git a/network/Network.cpp b/network/Network.cpp index c450c73a..f9fe4018 100644 --- a/network/Network.cpp +++ b/network/Network.cpp @@ -53,18 +53,22 @@ using namespace network; /// Unique ID of this modem on the network. /// Network authentication password. /// Flag indicating full-duplex operation. +/// Flag indicating whether DMR is enabled. +/// Flag indicating whether P25 is enabled. /// Flag indicating whether DMR slot 1 is enabled for network traffic. /// Flag indicating whether DMR slot 2 is enabled for network traffic. /// Flag indicating that the system activity logs will be sent to the network. /// Flag indicating that the system diagnostic logs will be sent to the network. /// Flag indicating that the system will accept radio ID and talkgroup ID lookups from the network. Network::Network(const std::string& address, uint16_t port, uint16_t local, uint32_t id, const std::string& password, - bool duplex, bool debug, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool updateLookup) : + bool duplex, bool debug, bool dmr, bool p25, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool updateLookup) : BaseNetwork(local, id, duplex, debug, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer), m_address(address), m_port(port), m_password(password), m_enabled(false), + m_dmrEnabled(dmr), + m_p25Enabled(p25), m_updateLookup(updateLookup), m_identity(), m_rxFrequency(0U), @@ -204,7 +208,7 @@ void Network::clock(uint32_t ms) } if (::memcmp(m_buffer, TAG_DMR_DATA, 4U) == 0) { - if (m_enabled) { + if (m_enabled && m_dmrEnabled) { if (m_debug) Utils::dump(1U, "Network Received, DMR", m_buffer, length); @@ -214,7 +218,7 @@ void Network::clock(uint32_t ms) } } else if (::memcmp(m_buffer, TAG_P25_DATA, 4U) == 0) { - if (m_enabled) { + if (m_enabled && m_p25Enabled) { if (m_debug) Utils::dump(1U, "Network Received, P25", m_buffer, length); diff --git a/network/Network.h b/network/Network.h index c7d767b3..4fbec0eb 100644 --- a/network/Network.h +++ b/network/Network.h @@ -50,7 +50,7 @@ namespace network public: /// Initializes a new instance of the Network class. Network(const std::string& address, uint16_t port, uint16_t local, uint32_t id, const std::string& password, - bool duplex, bool debug, bool slot1, bool slot2, bool transferActivityLog, bool transferDiagnosticLog, bool updateLookup); + bool duplex, bool debug, bool dmr, bool p25, bool slot1, bool slot2, bool transferActivityLog, bool transferDiagnosticLog, bool updateLookup); /// Finalizes a instance of the Network class. ~Network(); @@ -84,6 +84,9 @@ namespace network bool m_enabled; + bool m_dmrEnabled; + bool m_p25Enabled; + bool m_updateLookup; lookups::RadioIdLookup* m_ridLookup;