|
|
@ -269,23 +269,23 @@ int CYSFGateway::run()
|
|
|
|
|
|
|
|
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector();
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector();
|
|
|
|
if (m_ysfNetwork != NULL && m_linkType == LINK_YSF && wiresXCommandPassthrough) {
|
|
|
|
if (m_ysfNetwork != NULL && m_linkType == LINK_YSF && wiresXCommandPassthrough) {
|
|
|
|
if (reflector->m_wiresX) {
|
|
|
|
if (reflector->m_wiresX) {
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, true, wiresXCommandPassthrough);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, true, wiresXCommandPassthrough);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (wiresXCommandPassthrough) {
|
|
|
|
} else if (wiresXCommandPassthrough) {
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processDTMF(buffer, dt);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
|
|
|
|
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
@ -460,21 +460,21 @@ void CYSFGateway::createGPS()
|
|
|
|
|
|
|
|
|
|
|
|
bool enabled = m_conf.getMobileGPSEnabled();
|
|
|
|
bool enabled = m_conf.getMobileGPSEnabled();
|
|
|
|
if (enabled) {
|
|
|
|
if (enabled) {
|
|
|
|
std::string address = m_conf.getMobileGPSAddress();
|
|
|
|
std::string address = m_conf.getMobileGPSAddress();
|
|
|
|
unsigned int port = m_conf.getMobileGPSPort();
|
|
|
|
unsigned int port = m_conf.getMobileGPSPort();
|
|
|
|
|
|
|
|
|
|
|
|
m_writer->setMobileLocation(address, port);
|
|
|
|
m_writer->setMobileLocation(address, port);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
float latitude = m_conf.getLatitude();
|
|
|
|
float latitude = m_conf.getLatitude();
|
|
|
|
float longitude = m_conf.getLongitude();
|
|
|
|
float longitude = m_conf.getLongitude();
|
|
|
|
int height = m_conf.getHeight();
|
|
|
|
int height = m_conf.getHeight();
|
|
|
|
|
|
|
|
|
|
|
|
m_writer->setStaticLocation(latitude, longitude, height);
|
|
|
|
m_writer->setStaticLocation(latitude, longitude, height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool ret = m_writer->open();
|
|
|
|
bool ret = m_writer->open();
|
|
|
|
if (!ret) {
|
|
|
|
if (!ret) {
|
|
|
|
delete m_writer;
|
|
|
|
delete m_writer;
|
|
|
|
m_writer = NULL;
|
|
|
|
m_writer = NULL;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -550,9 +550,9 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u
|
|
|
|
|
|
|
|
|
|
|
|
// If we are linking to a YSF2xxx mode, send the YSF2xxx gateway the link command too
|
|
|
|
// If we are linking to a YSF2xxx mode, send the YSF2xxx gateway the link command too
|
|
|
|
if (reflector->m_wiresX && wiresXCommandPassthrough) {
|
|
|
|
if (reflector->m_wiresX && wiresXCommandPassthrough) {
|
|
|
|
LogMessage("Forward WiresX Connect to \"%s\"", reflector->m_name.c_str());
|
|
|
|
LogMessage("Forward WiresX Connect to \"%s\"", reflector->m_name.c_str());
|
|
|
|
m_wiresX->sendConnect(m_ysfNetwork);
|
|
|
|
m_wiresX->sendConnect(m_ysfNetwork);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case WXS_CONNECT_FCS: {
|
|
|
|
case WXS_CONNECT_FCS: {
|
|
|
@ -659,43 +659,43 @@ void CYSFGateway::processDTMF(unsigned char* buffer, unsigned char dt)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case WXS_CONNECT_FCS: {
|
|
|
|
case WXS_CONNECT_FCS: {
|
|
|
|
std::string raw = m_dtmf.getReflector();
|
|
|
|
std::string raw = m_dtmf.getReflector();
|
|
|
|
std::string id = "FCS00";
|
|
|
|
std::string id = "FCS00";
|
|
|
|
if (raw.length() == 2U) {
|
|
|
|
if (raw.length() == 2U) {
|
|
|
|
id += raw.at(0U) + std::string("0") + raw.at(1U);
|
|
|
|
id += raw.at(0U) + std::string("0") + raw.at(1U);
|
|
|
|
} else if (raw.length() == 3U) {
|
|
|
|
} else if (raw.length() == 3U) {
|
|
|
|
id += raw;
|
|
|
|
id += raw;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
LogWarning("Nonsense from the DTMF decoder - \"%s\"", raw.c_str());
|
|
|
|
LogWarning("Nonsense from the DTMF decoder - \"%s\"", raw.c_str());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (m_linkType == LINK_YSF) {
|
|
|
|
if (m_linkType == LINK_YSF) {
|
|
|
|
m_wiresX->processDisconnect();
|
|
|
|
m_wiresX->processDisconnect();
|
|
|
|
m_ysfNetwork->writeUnlink(3U);
|
|
|
|
m_ysfNetwork->writeUnlink(3U);
|
|
|
|
m_ysfNetwork->clearDestination();
|
|
|
|
m_ysfNetwork->clearDestination();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_linkType == LINK_FCS)
|
|
|
|
if (m_linkType == LINK_FCS)
|
|
|
|
m_fcsNetwork->writeUnlink(3U);
|
|
|
|
m_fcsNetwork->writeUnlink(3U);
|
|
|
|
|
|
|
|
|
|
|
|
m_current.clear();
|
|
|
|
m_current.clear();
|
|
|
|
m_inactivityTimer.stop();
|
|
|
|
m_inactivityTimer.stop();
|
|
|
|
m_lostTimer.stop();
|
|
|
|
m_lostTimer.stop();
|
|
|
|
m_linkType = LINK_NONE;
|
|
|
|
m_linkType = LINK_NONE;
|
|
|
|
|
|
|
|
|
|
|
|
LogMessage("Connect via DTMF to %s has been requested by %10.10s", id.c_str(), buffer + 14U);
|
|
|
|
LogMessage("Connect via DTMF to %s has been requested by %10.10s", id.c_str(), buffer + 14U);
|
|
|
|
|
|
|
|
|
|
|
|
bool ok = m_fcsNetwork->writeLink(id);
|
|
|
|
bool ok = m_fcsNetwork->writeLink(id);
|
|
|
|
if (ok) {
|
|
|
|
if (ok) {
|
|
|
|
m_current = id;
|
|
|
|
m_current = id;
|
|
|
|
m_inactivityTimer.start();
|
|
|
|
m_inactivityTimer.start();
|
|
|
|
m_lostTimer.start();
|
|
|
|
m_lostTimer.start();
|
|
|
|
m_linkType = LINK_FCS;
|
|
|
|
m_linkType = LINK_FCS;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
LogMessage("Unknown reflector - %s", id.c_str());
|
|
|
|
LogMessage("Unknown reflector - %s", id.c_str());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
if (m_linkType == LINK_YSF) {
|
|
|
|
if (m_linkType == LINK_YSF) {
|
|
|
|
m_wiresX->processDisconnect();
|
|
|
|
m_wiresX->processDisconnect();
|
|
|
@ -820,7 +820,7 @@ void CYSFGateway::startupLinking()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_startup.empty())
|
|
|
|
if (m_startup.empty())
|
|
|
|
LogMessage("No connection startup");
|
|
|
|
LogMessage("No connection startup");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CYSFGateway::readFCSRoomsFile(const std::string& filename)
|
|
|
|
void CYSFGateway::readFCSRoomsFile(const std::string& filename)
|
|
|
|