|
|
@ -244,6 +244,7 @@ int CYSFGateway::run()
|
|
|
|
|
|
|
|
|
|
|
|
m_startup = m_conf.getNetworkStartup();
|
|
|
|
m_startup = m_conf.getNetworkStartup();
|
|
|
|
bool revert = m_conf.getNetworkRevert();
|
|
|
|
bool revert = m_conf.getNetworkRevert();
|
|
|
|
|
|
|
|
bool wiresXCommandPassthrough = m_conf.getWiresXCommandPassthrough();
|
|
|
|
|
|
|
|
|
|
|
|
startupLinking();
|
|
|
|
startupLinking();
|
|
|
|
|
|
|
|
|
|
|
@ -266,12 +267,18 @@ int CYSFGateway::run()
|
|
|
|
unsigned char fn = fich.getFN();
|
|
|
|
unsigned char fn = fich.getFN();
|
|
|
|
unsigned char ft = fich.getFT();
|
|
|
|
unsigned char ft = fich.getFT();
|
|
|
|
|
|
|
|
|
|
|
|
// Don't send out control data
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector();
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
if ( (wiresXCommandPassthrough) && (m_linkType == LINK_YSF) && (reflector->m_name.rfind("YSF2DMR", 0) == 0 || reflector->m_name.rfind("YSF2P25", 0) == 0 || reflector->m_name.rfind("YSF2NXDN", 0) == 0) ) {
|
|
|
|
|
|
|
|
// Allow WiresX to Pass Through
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, true);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
// Don't Pass Control Commands
|
|
|
|
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (m_gps != NULL)
|
|
|
|
if (m_gps != NULL)
|
|
|
|
m_gps->data(buffer + 14U, buffer + 35U, fi, dt, fn, ft);
|
|
|
|
m_gps->data(buffer + 14U, buffer + 35U, fi, dt, fn, ft);
|
|
|
@ -507,11 +514,11 @@ void CYSFGateway::createWiresX(CYSFNetwork* rptNetwork)
|
|
|
|
m_wiresX->start();
|
|
|
|
m_wiresX->start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft)
|
|
|
|
void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft, bool wiresXCommandPassthrough)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert(buffer != NULL);
|
|
|
|
assert(buffer != NULL);
|
|
|
|
|
|
|
|
|
|
|
|
WX_STATUS status = m_wiresX->process(buffer + 35U, buffer + 14U, fi, dt, fn, ft);
|
|
|
|
WX_STATUS status = m_wiresX->process(buffer + 35U, buffer + 14U, fi, dt, fn, ft, wiresXCommandPassthrough);
|
|
|
|
switch (status) {
|
|
|
|
switch (status) {
|
|
|
|
case WXS_CONNECT_YSF: {
|
|
|
|
case WXS_CONNECT_YSF: {
|
|
|
|
if (m_linkType == LINK_YSF)
|
|
|
|
if (m_linkType == LINK_YSF)
|
|
|
@ -567,6 +574,10 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
if (m_linkType == LINK_YSF) {
|
|
|
|
if (m_linkType == LINK_YSF) {
|
|
|
|
LogMessage("Disconnect has been requested by %10.10s", buffer + 14U);
|
|
|
|
LogMessage("Disconnect has been requested by %10.10s", buffer + 14U);
|
|
|
|
|
|
|
|
if ( (wiresXCommandPassthrough) && (::memcmp(buffer + 0U, "YSFD", 4U) == 0) ) {
|
|
|
|
|
|
|
|
// Send the disconnect to the YSF2xxx gateway too
|
|
|
|
|
|
|
|
m_ysfNetwork->write(buffer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_ysfNetwork->writeUnlink(3U);
|
|
|
|
m_ysfNetwork->writeUnlink(3U);
|
|
|
|
m_ysfNetwork->clearDestination();
|
|
|
|
m_ysfNetwork->clearDestination();
|
|
|
|