From 8b35da0c3d1a65df536841f50d0687289e74b61a Mon Sep 17 00:00:00 2001 From: Doug McLain Date: Sun, 28 Jun 2020 14:49:41 -0400 Subject: [PATCH 1/2] README updates --- DMR2P25/README.md | 3 ++- P252DMR/README.md | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DMR2P25/README.md b/DMR2P25/README.md index 6f09cf3..6de3a29 100644 --- a/DMR2P25/README.md +++ b/DMR2P25/README.md @@ -4,7 +4,7 @@ This is the source code of DMR2P25, a software for digital voice conversion from You can use this software with MMDVMHost and P25Gateway, with the default UDP ports: -MMDVMHost <-> DMR2P25 <-> P25Gateway +MMDVMHost(DMR Mode):62032 <-> 62037:DMR2P25:32010 <-> 42020:P25Gateway:42010 <-> (P25Reflector) Program your DMR radio with P25 TG numbers. @@ -15,6 +15,7 @@ This software is licenced under the GPL v2 and is intended for amateur and educa This utility is not built with the other cross mode ulitities, and has 2 external dependencies: imbe_vocoder https://github.com/nostar/imbe_vocoder + md380_vocoder https://github.com/nostar/md380_vocoder With these dependencies installed, run 'make' from the source directory. diff --git a/P252DMR/README.md b/P252DMR/README.md index c773eea..00364d0 100644 --- a/P252DMR/README.md +++ b/P252DMR/README.md @@ -1,6 +1,10 @@ # Description -This is the source code of P252DMR, a software for digital voice conversion from P25 to DMR digital mode, based on Jonathan G4KLX's [MMDVM](https://github.com/g4klx) software. Unlike the other cross mode utilities upon which this is based, this utility performs software transcoding between IMBE 4400x2800(P25) and AMBE+2 2450x1150(DMR). +This is the source code of P252DMR, a software for digital voice conversion from P25 to DMR digital mode, based on Jonathan G4KLX's [MMDVM](https://github.com/g4klx) software. Unlike the other cross mode utilities upon which this is based, this utility performs software transcoding between IMBE 4400x2800(P25) and AMBE+2 2450x1150(DMR). + +You can use this software with MMDVMHost and P25Gateway, with the default UDP ports: + +MMDVMHost(P25 Mode):32010 <-> 42020:P25Gateway:42010 <-> 42012:P252DMR <-> (DMR Master server) If you want to connect directly to a XLX reflector (with DMR support), you only need to uncomment ([DMR Network] section): From a3f746ddfad7d94c3b43a57075c3f73be5770bed Mon Sep 17 00:00:00 2001 From: Doug McLain Date: Sat, 17 Oct 2020 20:46:53 -0400 Subject: [PATCH 2/2] Add XLXHosts support to P252DMR and re-link to XLX after DMR timeout --- P252DMR/DMRNetwork.cpp | 14 +++++++++----- P252DMR/DMRNetwork.h | 2 +- P252DMR/P252DMR.cpp | 8 +++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/P252DMR/DMRNetwork.cpp b/P252DMR/DMRNetwork.cpp index 484413b..e0cb6a0 100644 --- a/P252DMR/DMRNetwork.cpp +++ b/P252DMR/DMRNetwork.cpp @@ -329,8 +329,9 @@ void CDMRNetwork::close() m_timeoutTimer.stop(); } -void CDMRNetwork::clock(unsigned int ms) +bool CDMRNetwork::clock(unsigned int ms) { + bool r = false; m_delayBuffers[1U]->clock(ms); m_delayBuffers[2U]->clock(ms); @@ -341,7 +342,7 @@ void CDMRNetwork::clock(unsigned int ms) if (ret) { ret = writeLogin(); if (!ret) - return; + return true; m_status = WAITING_LOGIN; m_timeoutTimer.start(); @@ -350,7 +351,7 @@ void CDMRNetwork::clock(unsigned int ms) m_retryTimer.start(); } - return; + return false; } in_addr address; @@ -360,7 +361,7 @@ void CDMRNetwork::clock(unsigned int ms) LogError("DMR, Socket has failed, retrying connection to the master"); close(); open(); - return; + return true; } // if (m_debug && length > 0) @@ -386,7 +387,7 @@ void CDMRNetwork::clock(unsigned int ms) LogError("DMR, Login to the master has failed, retrying network ..."); close(); open(); - return; + return true; } } else if (::memcmp(m_buffer, "RPTACK", 6U) == 0) { switch (m_status) { @@ -430,6 +431,7 @@ void CDMRNetwork::clock(unsigned int ms) LogError("DMR, Master is closing down"); close(); open(); + r = true; } else if (::memcmp(m_buffer, "MSTPONG", 7U) == 0) { m_timeoutTimer.start(); } else if (::memcmp(m_buffer, "RPTSBKN", 7U) == 0) { @@ -469,7 +471,9 @@ void CDMRNetwork::clock(unsigned int ms) LogError("DMR, Connection to the master has timed out, retrying connection"); close(); open(); + r = true; } + return r; } void CDMRNetwork::reset(unsigned int slotNo) diff --git a/P252DMR/DMRNetwork.h b/P252DMR/DMRNetwork.h index 65b019e..bf62445 100644 --- a/P252DMR/DMRNetwork.h +++ b/P252DMR/DMRNetwork.h @@ -52,7 +52,7 @@ public: bool wantsBeacon(); - void clock(unsigned int ms); + bool clock(unsigned int ms); void reset(unsigned int slotNo); diff --git a/P252DMR/P252DMR.cpp b/P252DMR/P252DMR.cpp index e3d01f9..95a056d 100644 --- a/P252DMR/P252DMR.cpp +++ b/P252DMR/P252DMR.cpp @@ -298,6 +298,10 @@ int CP252DMR::run() std::string p25_localAddress = m_conf.getP25LocalAddress(); unsigned int p25_localPort = m_conf.getP25LocalPort(); bool p25_debug = m_conf.getP25NetworkDebug(); + + std::string fileName = m_conf.getDMRXLXFile(); + m_xlxReflectors = new CReflectors(fileName, 60U); + m_xlxReflectors->load(); m_p25Network = new CP25Network(p25_localAddress, p25_localPort, p25_dstAddress, p25_dstPort, m_callsign, p25_debug); @@ -788,7 +792,9 @@ int CP252DMR::run() pollTimer.start(); } - m_dmrNetwork->clock(ms); + if(m_dmrNetwork->clock(ms)){ + m_xlxConnected = false; + } if (m_xlxReflectors != NULL) m_xlxReflectors->clock(ms);