Merge pull request #49 from nostar/master

Add XLXHosts support to P252DMR and re-link to XLX after DMR timeout
This commit is contained in:
Andy CA6JAU 2020-10-22 14:53:05 -03:00 committed by GitHub
commit b9c3c3fc96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 9 deletions

View File

@ -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.

View File

@ -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)

View File

@ -52,7 +52,7 @@ public:
bool wantsBeacon();
void clock(unsigned int ms);
bool clock(unsigned int ms);
void reset(unsigned int slotNo);

View File

@ -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);

View File

@ -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):