1
0
Fork 0

Merge pull request #133 from AndyTaylorTweet/patch-6

Update YSFGateway.cpp
ycs232-kbc
Jonathan Naylor 6 years ago committed by GitHub
commit b7a5e48a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -268,25 +268,23 @@ int CYSFGateway::run()
unsigned char ft = fich.getFT();
CYSFReflector* reflector = m_wiresX->getReflector();
if (m_ysfNetwork != NULL && m_linkType == LINK_YSF) {
// Connected to a YSF reflector, figure out what kind it is
if ( (wiresXCommandPassthrough) && (reflector->m_wiresX) ) {
// Pass Control Commands (WiresX capable reflector)
if (m_ysfNetwork != NULL && m_linkType == LINK_YSF && wiresXCommandPassthrough) {
if (reflector->m_wiresX) {
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, true);
}
else {
// Don't Pass Control Commands (Not a WiresX capable reflector)
processWiresX(buffer, fi, dt, fn, ft, true, wiresXCommandPassthrough);
} else {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false);
}
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
}
else {
// Don't Pass Control Commands (Not connected to a reflector)
} else if (wiresXCommandPassthrough) {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
} else {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
}
if (m_gps != NULL)
@ -523,11 +521,11 @@ void CYSFGateway::createWiresX(CYSFNetwork* rptNetwork)
m_wiresX->start();
}
void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft, bool wiresXCommandPassthrough)
void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft, bool dontProcessWiresXLocal, bool wiresXCommandPassthrough)
{
assert(buffer != NULL);
WX_STATUS status = m_wiresX->process(buffer + 35U, buffer + 14U, fi, dt, fn, ft, wiresXCommandPassthrough);
WX_STATUS status = m_wiresX->process(buffer + 35U, buffer + 14U, fi, dt, fn, ft, dontProcessWiresXLocal);
switch (status) {
case WXS_CONNECT_YSF: {
if (m_linkType == LINK_YSF)
@ -550,7 +548,8 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u
m_linkType = LINK_YSF;
// If we are linking to a YSF2xxx mode, send the YSF2xxx gateway the link command too
if ( (wiresXCommandPassthrough) && (reflector->m_wiresX) ) {
if (reflector->m_wiresX && wiresXCommandPassthrough) {
LogMessage("Forward WiresX Connect to \"%s\"", reflector->m_name.c_str());
m_wiresX->sendConnect(m_ysfNetwork);
}
}

Loading…
Cancel
Save