From 157bc8c058c244553329ec972a241079bf510f13 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Sep 2016 13:09:02 +0200 Subject: [PATCH 1/3] Disable networks by default or if missing in MMDVM.ini --- Conf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index bf1809100..eeead4960 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -118,12 +118,12 @@ m_fusionEnabled(true), m_fusionRemoteGateway(false), m_p25Enabled(true), m_p25NAC(0x293U), -m_dstarNetworkEnabled(true), +m_dstarNetworkEnabled(false), m_dstarGatewayAddress(), m_dstarGatewayPort(0U), m_dstarLocalPort(0U), m_dstarNetworkDebug(false), -m_dmrNetworkEnabled(true), +m_dmrNetworkEnabled(false), m_dmrNetworkAddress(), m_dmrNetworkPort(0U), m_dmrNetworkLocal(0U), @@ -139,7 +139,7 @@ m_fusionNetworkMyPort(0U), m_fusionNetworkGwyAddress(), m_fusionNetworkGwyPort(0U), m_fusionNetworkDebug(false), -m_p25NetworkEnabled(true), +m_p25NetworkEnabled(false), m_p25GatewayAddress(), m_p25GatewayPort(0U), m_p25LocalPort(0U), From c0ac75ba2f6ef411de8c169b48148b52c2733d07 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 29 Sep 2016 17:45:38 +0100 Subject: [PATCH 2/3] Fix P25 network infinite recursion. --- P25Control.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/P25Control.cpp b/P25Control.cpp index 139626ec0..00039f388 100644 --- a/P25Control.cpp +++ b/P25Control.cpp @@ -337,8 +337,13 @@ void CP25Control::writeNetwork() break; case 0x6AU: ::memcpy(m_netLDU1 + 200U, data, 16U); - if (m_netState != RS_NET_IDLE) + if (m_netState != RS_NET_IDLE) { + // Check for an unflushed LDU2 + void* p = ::memchr(m_netLDU2, 0x02U, 9U * 25U); + if (p != NULL) + createNetLDU2(); createNetLDU1(); + } break; case 0x6BU: ::memcpy(m_netLDU2 + 0U, data, 22U); @@ -366,9 +371,14 @@ void CP25Control::writeNetwork() break; case 0x73U: ::memcpy(m_netLDU2 + 200U, data, 16U); - if (m_netState != RS_NET_IDLE) { + if (m_netState == RS_NET_IDLE) { createNetHeader(); createNetLDU1(); + } else { + // Check for an unflushed LDU1 + void* p = ::memchr(m_netLDU1, 0x02U, 9U * 25U); + if (p != NULL) + createNetLDU1(); } createNetLDU2(); break; @@ -641,11 +651,6 @@ void CP25Control::createNetHeader() void CP25Control::createNetLDU1() { - // Check for an unflushed LDU2 - void* p = ::memchr(m_netLDU2, 0x02U, 9U * 25U); - if (p != NULL) - createNetLDU2(); - insertMissingAudio(m_netLDU1); unsigned char buffer[P25_LDU_FRAME_LENGTH_BYTES + 2U]; @@ -695,11 +700,6 @@ void CP25Control::createNetLDU1() void CP25Control::createNetLDU2() { - // Check for an unflushed LDU1 - void* p = ::memchr(m_netLDU1, 0x02U, 9U * 25U); - if (p != NULL) - createNetLDU1(); - insertMissingAudio(m_netLDU2); unsigned char buffer[P25_LDU_FRAME_LENGTH_BYTES + 2U]; From 897d8c7d925cab8fae28beef1421afeb602bc550 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 29 Sep 2016 17:48:29 +0100 Subject: [PATCH 3/3] Remove annoying RS decoder failure log message. --- P25Data.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/P25Data.cpp b/P25Data.cpp index 1933590f7..a2d6b4839 100644 --- a/P25Data.cpp +++ b/P25Data.cpp @@ -97,10 +97,8 @@ bool CP25Data::decodeLDU1(const unsigned char* data) decodeLDUHamming(raw, rs + 15U); bool ret = m_rs241213.decode(rs); - if (!ret) { - LogDebug("P25, uncorrectable errors in the RS(24,12,13) code"); + if (!ret) return false; - } switch (m_lcf) { case P25_LCF_GROUP: