1
0
Fork 0

Update YSFGateway.cpp

Added an extra field to the logic for sorting out when WiresX is processed locally and when it's not. This is done to make sure that the correct state is always matched, and that WiresX can only ever make it to a YSF2xxx subordinate, and that WiresX connect is ONLY generated when WiresX Passthrough is on.

Added Logging to show when WiresX Command is sent to WiresX enabled subordinate YSF2xxx Gateway
ycs232-kbc
Andy Taylor 6 years ago committed by GitHub
parent 327c6d0853
commit 76211e05be
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