|
|
|
@ -322,19 +322,20 @@ int CYSFGateway::run()
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// XXX call reset() on end of transmission.
|
|
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
|
case WXS_CONNECT: {
|
|
|
|
|
unsigned int refl = m_dtmf->getReflector();
|
|
|
|
|
// XXX validate reflector
|
|
|
|
|
// XXX Inform Wires-X
|
|
|
|
|
std::string refl = m_dtmf->getReflector();
|
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector(refl);
|
|
|
|
|
if (reflector != NULL) {
|
|
|
|
|
m_wiresX->processConnect(reflector);
|
|
|
|
|
|
|
|
|
|
if (m_linked) {
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector();
|
|
|
|
|
LogMessage("Connect to %5.5s has been requested by %10.10s", reflector->m_id.c_str(), buffer + 14U);
|
|
|
|
|
LogMessage("Connect via DTMF to %5.5s has been requested by %10.10s", reflector->m_id.c_str(), buffer + 14U);
|
|
|
|
|
|
|
|
|
|
m_netNetwork->setDestination(reflector->m_address, reflector->m_port);
|
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
@ -347,10 +348,13 @@ int CYSFGateway::run()
|
|
|
|
|
|
|
|
|
|
m_linked = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
|
// XXX Inform Wires-X
|
|
|
|
|
LogMessage("Disconnect has been requested by %10.10s", buffer + 14U);
|
|
|
|
|
if (m_linked) {
|
|
|
|
|
m_wiresX->processDisconnect();
|
|
|
|
|
|
|
|
|
|
LogMessage("Disconnect via DTMF has been requested by %10.10s", buffer + 14U);
|
|
|
|
|
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
@ -362,6 +366,7 @@ int CYSFGateway::run()
|
|
|
|
|
pollTimer.stop();
|
|
|
|
|
|
|
|
|
|
m_linked = false;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
@ -381,6 +386,8 @@ int CYSFGateway::run()
|
|
|
|
|
if ((buffer[34U] & 0x01U) == 0x01U) {
|
|
|
|
|
if (m_gps != NULL)
|
|
|
|
|
m_gps->reset();
|
|
|
|
|
if (m_dtmf != NULL)
|
|
|
|
|
m_dtmf->reset();
|
|
|
|
|
m_exclude = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|