1
0
Fork 0

Closer to working.

ycs232-kbc
Jonathan Naylor 4 years ago
parent ce8e34959f
commit be1e3aa4fa

@ -241,6 +241,8 @@ int CDGIdGateway::run()
dgIdNetwork[dgid]->m_static = statc; dgIdNetwork[dgid]->m_static = statc;
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime; dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
dgIdNetwork[dgid]->m_netHangTime = netHangTime; dgIdNetwork[dgid]->m_netHangTime = netHangTime;
LogMessage("Added FCS:%s to DG-ID %u", name.c_str(), dgid);
} else if (type == "YSF") { } else if (type == "YSF") {
std::string name = (*it)->m_name; std::string name = (*it)->m_name;
unsigned int local = (*it)->m_local; unsigned int local = (*it)->m_local;
@ -248,11 +250,15 @@ int CDGIdGateway::run()
CYSFReflector* reflector = reflectors->findByName(name); CYSFReflector* reflector = reflectors->findByName(name);
if (reflector != NULL) { if (reflector != NULL) {
dgIdNetwork[dgid] = new CYSFNetwork(local, reflector->m_name, reflector->m_addr, reflector->m_addrLen, m_callsign, options, debug);; dgIdNetwork[dgid] = new CYSFNetwork(local, reflector->m_name, reflector->m_addr, reflector->m_addrLen, m_callsign, options, debug);
dgIdNetwork[dgid]->m_modes = DT_VD_MODE1 | DT_VD_MODE2 | DT_VOICE_FR_MODE | DT_DATA_FR_MODE; dgIdNetwork[dgid]->m_modes = DT_VD_MODE1 | DT_VD_MODE2 | DT_VOICE_FR_MODE | DT_DATA_FR_MODE;
dgIdNetwork[dgid]->m_static = statc; dgIdNetwork[dgid]->m_static = statc;
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime; dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
dgIdNetwork[dgid]->m_netHangTime = netHangTime; dgIdNetwork[dgid]->m_netHangTime = netHangTime;
LogMessage("Added YSF:%s to DG-ID %u", name.c_str(), dgid);
} else {
LogWarning("Unknown YSF reflector: %s", name.c_str());
} }
} else if (type == "IMRS") { } else if (type == "IMRS") {
if (imrs != NULL) { if (imrs != NULL) {
@ -269,6 +275,8 @@ int CDGIdGateway::run()
dest->m_addr = addr; dest->m_addr = addr;
dest->m_addrLen = addrLen; dest->m_addrLen = addrLen;
dests.push_back(dest); dests.push_back(dest);
LogMessage("Added IMRS:%s to DG-ID %u", name.c_str(), dgid);
} else { } else {
LogWarning("Unable to resolve the address for %s", (*it)->m_address.c_str()); LogWarning("Unable to resolve the address for %s", (*it)->m_address.c_str());
} }
@ -293,6 +301,8 @@ int CDGIdGateway::run()
dgIdNetwork[dgid]->m_static = statc; dgIdNetwork[dgid]->m_static = statc;
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime; dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
dgIdNetwork[dgid]->m_netHangTime = netHangTime; dgIdNetwork[dgid]->m_netHangTime = netHangTime;
LogMessage("Added Parrot to DG-ID %u", dgid);
} else { } else {
LogWarning("Unable to resolve the address for the YSF Parrot"); LogWarning("Unable to resolve the address for the YSF Parrot");
} }
@ -307,6 +317,8 @@ int CDGIdGateway::run()
dgIdNetwork[dgid]->m_static = statc; dgIdNetwork[dgid]->m_static = statc;
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime; dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
dgIdNetwork[dgid]->m_netHangTime = netHangTime; dgIdNetwork[dgid]->m_netHangTime = netHangTime;
LogMessage("Added YSF2DMR to DG-ID %u", dgid);
} else { } else {
LogWarning("Unable to resolve the address for YSF2DMR"); LogWarning("Unable to resolve the address for YSF2DMR");
} }
@ -321,6 +333,8 @@ int CDGIdGateway::run()
dgIdNetwork[dgid]->m_static = statc; dgIdNetwork[dgid]->m_static = statc;
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime; dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
dgIdNetwork[dgid]->m_netHangTime = netHangTime; dgIdNetwork[dgid]->m_netHangTime = netHangTime;
LogMessage("Added YSF2NXDN to DG-ID %u", dgid);
} else { } else {
LogWarning("Unable to resolve the address for YSF2NXDN"); LogWarning("Unable to resolve the address for YSF2NXDN");
} }
@ -335,6 +349,8 @@ int CDGIdGateway::run()
dgIdNetwork[dgid]->m_static = statc; dgIdNetwork[dgid]->m_static = statc;
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime; dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
dgIdNetwork[dgid]->m_netHangTime = netHangTime; dgIdNetwork[dgid]->m_netHangTime = netHangTime;
LogMessage("Added YSF2P25 to DG-ID %u", dgid);
} else { } else {
LogWarning("Unable to resolve the address for YSF2P25"); LogWarning("Unable to resolve the address for YSF2P25");
} }
@ -343,10 +359,11 @@ int CDGIdGateway::run()
if (dgIdNetwork[dgid] != NULL && dgIdNetwork[dgid] != imrs) { if (dgIdNetwork[dgid] != NULL && dgIdNetwork[dgid] != imrs) {
bool ret = dgIdNetwork[dgid]->open(); bool ret = dgIdNetwork[dgid]->open();
if (!ret) { if (!ret) {
LogWarning("\tUnable to open connection");
delete dgIdNetwork[dgid]; delete dgIdNetwork[dgid];
dgIdNetwork[dgid] = NULL; dgIdNetwork[dgid] = NULL;
} } else if (dgIdNetwork[dgid]->m_static) {
if (dgIdNetwork[dgid] != NULL && dgIdNetwork[dgid]->m_static) { LogMessage("\tLinking at startup");
dgIdNetwork[dgid]->link(); dgIdNetwork[dgid]->link();
dgIdNetwork[dgid]->link(); dgIdNetwork[dgid]->link();
dgIdNetwork[dgid]->link(); dgIdNetwork[dgid]->link();

@ -152,9 +152,9 @@ void CYSFNetwork::link()
if (m_state != DS_NOTLINKED) if (m_state != DS_NOTLINKED)
return; return;
writePoll();
m_state = DS_LINKING; m_state = DS_LINKING;
writePoll();
} }
void CYSFNetwork::writePoll() void CYSFNetwork::writePoll()
@ -164,10 +164,17 @@ void CYSFNetwork::writePoll()
m_pollTimer.start(); m_pollTimer.start();
if (m_debug)
CUtils::dump(1U, "YSF Network Data Sent", m_poll, 14U);
m_socket.write(m_poll, 14U, m_addr, m_addrLen); m_socket.write(m_poll, 14U, m_addr, m_addrLen);
if (m_options != NULL) if (m_options != NULL) {
if (m_debug)
CUtils::dump(1U, "YSF Network Data Sent", m_options, 50U);
m_socket.write(m_options, 50U, m_addr, m_addrLen); m_socket.write(m_options, 50U, m_addr, m_addrLen);
}
} }
void CYSFNetwork::unlink() void CYSFNetwork::unlink()
@ -177,6 +184,9 @@ void CYSFNetwork::unlink()
m_pollTimer.stop(); m_pollTimer.stop();
if (m_debug)
CUtils::dump(1U, "YSF Network Data Sent", m_unlink, 14U);
m_socket.write(m_unlink, 14U, m_addr, m_addrLen); m_socket.write(m_unlink, 14U, m_addr, m_addrLen);
m_state = DS_NOTLINKED; m_state = DS_NOTLINKED;

@ -19,6 +19,6 @@
#if !defined(VERSION_H) #if !defined(VERSION_H)
#define VERSION_H #define VERSION_H
const char* VERSION = "20200920"; const char* VERSION = "20200921";
#endif #endif

Loading…
Cancel
Save